// Lean compiler output
// Module: Lake.Reservoir
// Imports: public import Lake.Util.JsonObject public import Lake.Util.Version public import Lake.Config.Env public import Lake.Util.Reservoir import Lake.Util.Proc import Lake.Util.Url
#include <lean/lean.h>
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wunused-label"
#elif defined(__GNUC__) && !defined(__CLANG__)
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunused-label"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
#ifdef __cplusplus
extern "C" {
#endif
lean_object* l_Lean_Json_getObj_x3f(lean_object*);
static lean_object* l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__3;
LEAN_EXPORT lean_object* l_Lake_RegistryPkg_fromJson_x3f(lean_object*);
static lean_object* l_Lake_RegistrySrc_fromJson_x3f___closed__3;
static lean_object* l_Lake_Reservoir_fetchPkg_x3f___closed__2;
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_ctorIdx___boxed(lean_object*, lean_object*);
static lean_object* l_Option_fromJson_x3f___at___00Lake_RegistrySrc_fromJson_x3f_spec__0___closed__0;
lean_object* lean_mk_empty_array_with_capacity(lean_object*);
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_ctorElim___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lake_Reservoir_fetchPkgVersions(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_ctorIdx___redArg___boxed(lean_object*);
static lean_object* l_Lake_RegistryVer_fromJson_x3f___closed__3;
lean_object* l_Lake_StdVer_parseM(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_git_elim(lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lake_RegistryPkg_fromJson_x3f___closed__7;
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_data___boxed(lean_object*);
static lean_object* l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0___closed__1;
LEAN_EXPORT lean_object* l_Lake_instFromJsonRegistryVer;
static lean_object* l_Lake_RegistryVer_fromJson_x3f___closed__0;
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0(lean_object*);
static lean_object* l_Lake_Reservoir_pkgApiUrl___closed__0;
static lean_object* l_Lake_RegistrySrc_fromJson_x3f___closed__2;
lean_object* lean_array_push(lean_object*, lean_object*);
static lean_object* l_Lake_Reservoir_fetchPkg_x3f___closed__5;
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_mapMUnsafe_map___at___00Array_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0_spec__0_spec__0(size_t, size_t, lean_object*);
lean_object* l_Lake_JsonObject_getJson_x3f(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_ctorElim___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1(lean_object*);
lean_object* l_String_Slice_trimAscii(lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00Lake_RegistryPkg_gitSrc_x3f_spec__0___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_instFromJson;
LEAN_EXPORT lean_object* l_Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1(lean_object*);
LEAN_EXPORT lean_object* l_Option_fromJson_x3f___at___00Lake_RegistrySrc_fromJson_x3f_spec__1(lean_object*);
extern lean_object* l_Lake_Reservoir_lakeHeaders;
static lean_object* l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0___closed__1;
static lean_object* l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__6;
static lean_object* l_Lake_RegistrySrc_fromJson_x3f___closed__5;
static lean_object* l_Lake_RegistryPkg_fromJson_x3f___closed__2;
uint8_t lean_string_dec_eq(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lake_RegistryVer_fromJson_x3f(lean_object*);
lean_object* lean_string_utf8_byte_size(lean_object*);
static lean_object* l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__0;
static lean_object* l_Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1___closed__1;
static lean_object* l_Lake_instInhabitedRegistryPkg_default___closed__1;
static lean_object* l_Lake_Reservoir_pkgVersionsApiUrl___closed__0;
static lean_object* l_Lake_Reservoir_fetchPkg_x3f___closed__4;
static lean_object* l_Lake_RegistrySrc_fromJson_x3f___closed__9;
lean_object* l_Lean_Json_getStr_x3f(lean_object*);
lean_object* l_Nat_reprFast(lean_object*);
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_isGit___boxed(lean_object*);
static lean_object* l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__7;
static lean_object* l_Lake_RegistrySrc_instToJson___closed__0;
static lean_object* l_Lake_Reservoir_fetchPkg_x3f___closed__0;
lean_object* l_Array_empty(lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_mapMUnsafe_map___at___00Lake_RegistryPkg_fromJson_x3f_spec__0(size_t, size_t, lean_object*);
static lean_object* l_Lake_RegistryPkg_fromJson_x3f___closed__6;
static lean_object* l_Lake_Reservoir_pkgApiUrl___closed__1;
static lean_object* l_Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1___closed__0;
static lean_object* l_Lake_RegistryPkg_fromJson_x3f___closed__9;
static lean_object* l_Lake_RegistryPkg_gitSrc_x3f___closed__0;
static lean_object* l_Lake_RegistrySrc_fromJson_x3f___closed__0;
LEAN_EXPORT lean_object* l_Lake_Reservoir_fetchPkg_x3f___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lake_RegistryVer_fromJson_x3f___closed__6;
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_error_elim(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_mapMUnsafe_map___at___00Lake_RegistryPkg_fromJson_x3f_spec__0___boxed(lean_object*, lean_object*, lean_object*);
static lean_object* l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__5;
static lean_object* l___private_Lake_Reservoir_0__Lake_RegistryPkg_instToJson___closed__0;
static lean_object* l_Lake_RegistryPkg_fromJson_x3f___closed__1;
static lean_object* l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__2;
static lean_object* l_Lake_RegistrySrc_fromJson_x3f___closed__6;
static lean_object* l_Lake_RegistryVer_fromJson_x3f___closed__1;
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_ctorElim___redArg(lean_object*, lean_object*);
static lean_object* l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__11;
static lean_object* l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__4;
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_data(lean_object*);
static lean_object* l_Lake_RegistrySrc_fromJson_x3f___closed__8;
LEAN_EXPORT lean_object* l_Lake_instFromJsonReservoirResp___redArg(lean_object*);
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_ctorIdx(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Option_fromJson_x3f___at___00Lake_RegistrySrc_fromJson_x3f_spec__0(lean_object*);
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_data_elim___redArg(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lake_RegistryPkg_toJson(lean_object*);
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_ctorIdx___boxed(lean_object*);
LEAN_EXPORT lean_object* l_Lake_Reservoir_pkgVersionsApiUrl(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lake_Reservoir_0__Lake_RegistryPkg_instToJson;
static lean_object* l_Lake_RegistryPkg_fromJson_x3f___closed__8;
static lean_object* l_Lake_Reservoir_fetchPkgVersions___closed__0;
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_ctorIdx___redArg(lean_object*);
LEAN_EXPORT lean_object* l_Lake_Reservoir_fetchPkgVersions___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__12;
LEAN_EXPORT lean_object* l_Lake_instInhabitedRegistryPkg_default;
static lean_object* l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__1;
static lean_object* l_Lake_RegistryVer_fromJson_x3f___closed__7;
LEAN_EXPORT lean_object* l_Lake_RegistryPkg_toJson___boxed(lean_object*);
static lean_object* l_Lake_instFromJsonRegistryVer___closed__0;
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_mapMUnsafe_map___at___00Array_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0_spec__0_spec__0___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_other_elim___redArg(lean_object*, lean_object*);
static lean_object* l_Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1___closed__0;
static lean_object* l_Lake_RegistryPkg_fromJson_x3f___closed__0;
static lean_object* l_Lake_instInhabitedRegistryPkg_default___closed__0;
static lean_object* l_Lake_instInhabitedRegistrySrc_default___closed__0;
LEAN_EXPORT lean_object* l_Option_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0_spec__1(lean_object*);
LEAN_EXPORT lean_object* l_Array_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0_spec__0(lean_object*);
LEAN_EXPORT lean_object* l_Lake_instInhabitedRegistrySrc_default;
lean_object* l_Lean_instFromJsonJson___lam__0(lean_object*);
LEAN_EXPORT lean_object* l_Lake_Reservoir_fetchPkg_x3f(lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lake_Reservoir_fetchPkg_x3f___closed__1;
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_other_elim(lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lake_RegistryVer_fromJson_x3f___closed__4;
static lean_object* l_Lake_RegistrySrc_fromJson_x3f___closed__7;
static lean_object* l_Lake_RegistryPkg_instFromJson___closed__0;
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_ctorElim___redArg(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_fromJson_x3f(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lake_instFromJsonReservoirResp(lean_object*, lean_object*);
static lean_object* l_Lake_RegistryPkg_fromJson_x3f___closed__3;
static lean_object* l_Lake_RegistrySrc_fromJson_x3f___closed__1;
static lean_object* l_Lake_Reservoir_fetchPkg_x3f___closed__3;
uint8_t lean_nat_dec_eq(lean_object*, lean_object*);
static lean_object* l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__13;
LEAN_EXPORT lean_object* l_Lake_instInhabitedRegistrySrc;
LEAN_EXPORT lean_object* l_Lake_RegistryPkg_gitSrc_x3f(lean_object*);
lean_object* l_Lake_JsonObject_fromJson_x3f(lean_object*);
lean_object* l_String_Slice_toString(lean_object*);
static lean_object* l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__10;
lean_object* l_Lake_getUrl(lean_object*, lean_object*, lean_object*);
static lean_object* l_Lake_RegistrySrc_fromJson_x3f___closed__11;
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00Lake_RegistryPkg_gitSrc_x3f_spec__0(lean_object*, lean_object*, lean_object*, size_t, size_t, lean_object*);
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_instToJson;
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_ctorElim(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_ctorIdx(lean_object*);
lean_object* l_Option_fromJson_x3f___redArg(lean_object*, lean_object*);
lean_object* l_Lake_uriEncode(lean_object*, lean_object*);
static lean_object* l_Option_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0_spec__1___closed__0;
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_data_elim(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Json_getNat_x3f(lean_object*);
static lean_object* l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0___closed__0;
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_mapMUnsafe_map___at___00Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1_spec__1(size_t, size_t, lean_object*);
static lean_object* l_Lake_RegistryPkg_fromJson_x3f___closed__4;
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_fromJson_x3f___redArg(lean_object*, lean_object*);
static lean_object* l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__8;
size_t lean_usize_add(size_t, size_t);
lean_object* lean_array_uget(lean_object*, size_t);
size_t lean_array_size(lean_object*);
static lean_object* l_Lake_RegistryPkg_fromJson_x3f___closed__5;
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_git_elim___redArg(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Option_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0_spec__0(lean_object*);
static lean_object* l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__9;
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_toJson(lean_object*);
lean_object* lean_string_append(lean_object*, lean_object*);
static lean_object* l_Lake_RegistrySrc_fromJson_x3f___closed__10;
lean_object* lean_array_get_size(lean_object*);
static lean_object* l_Lake_instInhabitedRegistrySrc_default___closed__1;
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_ctorElim(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lake_RegistryPkg_instFromJson;
uint8_t lean_usize_dec_lt(size_t, size_t);
lean_object* l_Lean_Json_parse(lean_object*);
static lean_object* l_Lake_RegistrySrc_fromJson_x3f___closed__4;
static lean_object* l_Lake_RegistryVer_fromJson_x3f___closed__5;
lean_object* l___private_Lake_Util_Version_0__Lake_runVerParse(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Json_pretty(lean_object*, lean_object*);
LEAN_EXPORT uint8_t l_Lake_RegistrySrc_isGit(lean_object*);
static lean_object* l_Option_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0_spec__0___closed__0;
lean_object* lean_array_uset(lean_object*, size_t, lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_mapMUnsafe_map___at___00Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1_spec__1___boxed(lean_object*, lean_object*, lean_object*);
static lean_object* l_Lake_Reservoir_fetchPkgVersions___closed__1;
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_error_elim___redArg(lean_object*, lean_object*);
static lean_object* l_Lake_RegistryVer_fromJson_x3f___closed__2;
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0(lean_object*);
LEAN_EXPORT lean_object* l_Lake_instInhabitedRegistryPkg;
LEAN_EXPORT lean_object* l_Lake_RegistryPkg_gitSrc_x3f___boxed(lean_object*);
static lean_object* l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0___closed__0;
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_fromJson_x3f(lean_object*);
static lean_object* l_Lake_RegistrySrc_instFromJson___closed__0;
LEAN_EXPORT lean_object* l_Lake_Reservoir_pkgApiUrl(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_ctorIdx(lean_object* x_1) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
lean_object* x_2; 
x_2 = lean_unsigned_to_nat(0u);
return x_2;
}
else
{
lean_object* x_3; 
x_3 = lean_unsigned_to_nat(1u);
return x_3;
}
}
}
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_ctorIdx___boxed(lean_object* x_1) {
_start:
{
lean_object* x_2; 
x_2 = l_Lake_RegistrySrc_ctorIdx(x_1);
lean_dec_ref(x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_ctorElim___redArg(lean_object* x_1, lean_object* x_2) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; 
x_3 = lean_ctor_get(x_1, 0);
lean_inc(x_3);
x_4 = lean_ctor_get(x_1, 1);
lean_inc_ref(x_4);
x_5 = lean_ctor_get(x_1, 2);
lean_inc(x_5);
x_6 = lean_ctor_get(x_1, 3);
lean_inc(x_6);
x_7 = lean_ctor_get(x_1, 4);
lean_inc(x_7);
lean_dec_ref(x_1);
x_8 = lean_apply_5(x_2, x_3, x_4, x_5, x_6, x_7);
return x_8;
}
else
{
lean_object* x_9; lean_object* x_10; 
x_9 = lean_ctor_get(x_1, 0);
lean_inc(x_9);
lean_dec_ref(x_1);
x_10 = lean_apply_1(x_2, x_9);
return x_10;
}
}
}
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_ctorElim(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
lean_object* x_6; 
x_6 = l_Lake_RegistrySrc_ctorElim___redArg(x_3, x_5);
return x_6;
}
}
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_ctorElim___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
lean_object* x_6; 
x_6 = l_Lake_RegistrySrc_ctorElim(x_1, x_2, x_3, x_4, x_5);
lean_dec(x_2);
return x_6;
}
}
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_git_elim(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
lean_object* x_5; 
x_5 = l_Lake_RegistrySrc_ctorElim___redArg(x_2, x_4);
return x_5;
}
}
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_git_elim___redArg(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; 
x_3 = l_Lake_RegistrySrc_ctorElim___redArg(x_1, x_2);
return x_3;
}
}
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_other_elim(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
lean_object* x_5; 
x_5 = l_Lake_RegistrySrc_ctorElim___redArg(x_2, x_4);
return x_5;
}
}
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_other_elim___redArg(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; 
x_3 = l_Lake_RegistrySrc_ctorElim___redArg(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lake_instInhabitedRegistrySrc_default___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("", 0, 0);
return x_1;
}
}
static lean_object* _init_l_Lake_instInhabitedRegistrySrc_default___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
x_1 = lean_box(0);
x_2 = l_Lake_instInhabitedRegistrySrc_default___closed__0;
x_3 = lean_box(1);
x_4 = lean_alloc_ctor(0, 5, 0);
lean_ctor_set(x_4, 0, x_3);
lean_ctor_set(x_4, 1, x_2);
lean_ctor_set(x_4, 2, x_1);
lean_ctor_set(x_4, 3, x_1);
lean_ctor_set(x_4, 4, x_1);
return x_4;
}
}
static lean_object* _init_l_Lake_instInhabitedRegistrySrc_default() {
_start:
{
lean_object* x_1; 
x_1 = l_Lake_instInhabitedRegistrySrc_default___closed__1;
return x_1;
}
}
static lean_object* _init_l_Lake_instInhabitedRegistrySrc() {
_start:
{
lean_object* x_1; 
x_1 = l_Lake_instInhabitedRegistrySrc_default;
return x_1;
}
}
LEAN_EXPORT uint8_t l_Lake_RegistrySrc_isGit(lean_object* x_1) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
uint8_t x_2; 
x_2 = 1;
return x_2;
}
else
{
uint8_t x_3; 
x_3 = 0;
return x_3;
}
}
}
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_isGit___boxed(lean_object* x_1) {
_start:
{
uint8_t x_2; lean_object* x_3; 
x_2 = l_Lake_RegistrySrc_isGit(x_1);
lean_dec_ref(x_1);
x_3 = lean_box(x_2);
return x_3;
}
}
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_data(lean_object* x_1) {
_start:
{
lean_object* x_2; 
x_2 = lean_ctor_get(x_1, 0);
lean_inc(x_2);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_data___boxed(lean_object* x_1) {
_start:
{
lean_object* x_2; 
x_2 = l_Lake_RegistrySrc_data(x_1);
lean_dec_ref(x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_toJson(lean_object* x_1) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
lean_object* x_2; lean_object* x_3; 
x_2 = lean_ctor_get(x_1, 0);
lean_inc(x_2);
lean_dec_ref(x_1);
x_3 = lean_alloc_ctor(5, 1, 0);
lean_ctor_set(x_3, 0, x_2);
return x_3;
}
else
{
uint8_t x_4; 
x_4 = !lean_is_exclusive(x_1);
if (x_4 == 0)
{
lean_ctor_set_tag(x_1, 5);
return x_1;
}
else
{
lean_object* x_5; lean_object* x_6; 
x_5 = lean_ctor_get(x_1, 0);
lean_inc(x_5);
lean_dec(x_1);
x_6 = lean_alloc_ctor(5, 1, 0);
lean_ctor_set(x_6, 0, x_5);
return x_6;
}
}
}
}
static lean_object* _init_l_Lake_RegistrySrc_instToJson___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = lean_alloc_closure((void*)(l_Lake_RegistrySrc_toJson), 1, 0);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistrySrc_instToJson() {
_start:
{
lean_object* x_1; 
x_1 = l_Lake_RegistrySrc_instToJson___closed__0;
return x_1;
}
}
static lean_object* _init_l_Option_fromJson_x3f___at___00Lake_RegistrySrc_fromJson_x3f_spec__0___closed__0() {
_start:
{
lean_object* x_1; lean_object* x_2; 
x_1 = lean_box(0);
x_2 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Option_fromJson_x3f___at___00Lake_RegistrySrc_fromJson_x3f_spec__0(lean_object* x_1) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
lean_object* x_2; 
x_2 = l_Option_fromJson_x3f___at___00Lake_RegistrySrc_fromJson_x3f_spec__0___closed__0;
return x_2;
}
else
{
lean_object* x_3; 
x_3 = l_Lean_Json_getStr_x3f(x_1);
if (lean_obj_tag(x_3) == 0)
{
uint8_t x_4; 
x_4 = !lean_is_exclusive(x_3);
if (x_4 == 0)
{
return x_3;
}
else
{
lean_object* x_5; lean_object* x_6; 
x_5 = lean_ctor_get(x_3, 0);
lean_inc(x_5);
lean_dec(x_3);
x_6 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_6, 0, x_5);
return x_6;
}
}
else
{
uint8_t x_7; 
x_7 = !lean_is_exclusive(x_3);
if (x_7 == 0)
{
lean_object* x_8; lean_object* x_9; 
x_8 = lean_ctor_get(x_3, 0);
x_9 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_9, 0, x_8);
lean_ctor_set(x_3, 0, x_9);
return x_3;
}
else
{
lean_object* x_10; lean_object* x_11; lean_object* x_12; 
x_10 = lean_ctor_get(x_3, 0);
lean_inc(x_10);
lean_dec(x_3);
x_11 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_11, 0, x_10);
x_12 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_12, 0, x_11);
return x_12;
}
}
}
}
}
LEAN_EXPORT lean_object* l_Option_fromJson_x3f___at___00Lake_RegistrySrc_fromJson_x3f_spec__1(lean_object* x_1) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
lean_object* x_2; 
x_2 = l_Option_fromJson_x3f___at___00Lake_RegistrySrc_fromJson_x3f_spec__0___closed__0;
return x_2;
}
else
{
lean_object* x_3; 
x_3 = l_Lean_Json_getStr_x3f(x_1);
if (lean_obj_tag(x_3) == 0)
{
uint8_t x_4; 
x_4 = !lean_is_exclusive(x_3);
if (x_4 == 0)
{
return x_3;
}
else
{
lean_object* x_5; lean_object* x_6; 
x_5 = lean_ctor_get(x_3, 0);
lean_inc(x_5);
lean_dec(x_3);
x_6 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_6, 0, x_5);
return x_6;
}
}
else
{
uint8_t x_7; 
x_7 = !lean_is_exclusive(x_3);
if (x_7 == 0)
{
lean_object* x_8; lean_object* x_9; 
x_8 = lean_ctor_get(x_3, 0);
x_9 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_9, 0, x_8);
lean_ctor_set(x_3, 0, x_9);
return x_3;
}
else
{
lean_object* x_10; lean_object* x_11; lean_object* x_12; 
x_10 = lean_ctor_get(x_3, 0);
lean_inc(x_10);
lean_dec(x_3);
x_11 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_11, 0, x_10);
x_12 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_12, 0, x_11);
return x_12;
}
}
}
}
}
static lean_object* _init_l_Lake_RegistrySrc_fromJson_x3f___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("invalid registry source: ", 25, 25);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistrySrc_fromJson_x3f___closed__1() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("gitUrl", 6, 6);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistrySrc_fromJson_x3f___closed__2() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("gitUrl: ", 8, 8);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistrySrc_fromJson_x3f___closed__3() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("subDir", 6, 6);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistrySrc_fromJson_x3f___closed__4() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("subDir: ", 8, 8);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistrySrc_fromJson_x3f___closed__5() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("defaultBranch", 13, 13);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistrySrc_fromJson_x3f___closed__6() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("defaultBranch: ", 15, 15);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistrySrc_fromJson_x3f___closed__7() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("host", 4, 4);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistrySrc_fromJson_x3f___closed__8() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("host: ", 6, 6);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistrySrc_fromJson_x3f___closed__9() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("github", 6, 6);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistrySrc_fromJson_x3f___closed__10() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("repoUrl", 7, 7);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistrySrc_fromJson_x3f___closed__11() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("repoUrl: ", 9, 9);
return x_1;
}
}
LEAN_EXPORT lean_object* l_Lake_RegistrySrc_fromJson_x3f(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_7; 
x_7 = l_Lean_Json_getObj_x3f(x_1);
if (lean_obj_tag(x_7) == 0)
{
lean_object* x_8; 
x_8 = lean_ctor_get(x_7, 0);
lean_inc(x_8);
lean_dec_ref(x_7);
x_2 = x_8;
goto block_6;
}
else
{
lean_object* x_9; lean_object* x_10; lean_object* x_14; lean_object* x_15; 
x_9 = lean_ctor_get(x_7, 0);
lean_inc(x_9);
if (lean_is_exclusive(x_7)) {
 lean_ctor_release(x_7, 0);
 x_10 = x_7;
} else {
 lean_dec_ref(x_7);
 x_10 = lean_box(0);
}
x_14 = l_Lake_RegistrySrc_fromJson_x3f___closed__1;
x_15 = l_Lake_JsonObject_getJson_x3f(x_9, x_14);
if (lean_obj_tag(x_15) == 0)
{
goto block_13;
}
else
{
lean_object* x_16; lean_object* x_17; 
x_16 = lean_ctor_get(x_15, 0);
lean_inc(x_16);
lean_dec_ref(x_15);
x_17 = l_Option_fromJson_x3f___at___00Lake_RegistrySrc_fromJson_x3f_spec__0(x_16);
if (lean_obj_tag(x_17) == 0)
{
lean_object* x_18; lean_object* x_19; lean_object* x_20; 
lean_dec(x_10);
lean_dec(x_9);
x_18 = lean_ctor_get(x_17, 0);
lean_inc(x_18);
lean_dec_ref(x_17);
x_19 = l_Lake_RegistrySrc_fromJson_x3f___closed__2;
x_20 = lean_string_append(x_19, x_18);
lean_dec(x_18);
x_2 = x_20;
goto block_6;
}
else
{
if (lean_obj_tag(x_17) == 0)
{
lean_object* x_21; 
lean_dec(x_10);
lean_dec(x_9);
x_21 = lean_ctor_get(x_17, 0);
lean_inc(x_21);
lean_dec_ref(x_17);
x_2 = x_21;
goto block_6;
}
else
{
lean_object* x_22; lean_object* x_23; 
x_22 = lean_ctor_get(x_17, 0);
lean_inc(x_22);
if (lean_is_exclusive(x_17)) {
 lean_ctor_release(x_17, 0);
 x_23 = x_17;
} else {
 lean_dec_ref(x_17);
 x_23 = lean_box(0);
}
if (lean_obj_tag(x_22) == 1)
{
lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_31; lean_object* x_32; lean_object* x_44; lean_object* x_56; lean_object* x_57; 
lean_dec(x_10);
x_24 = lean_ctor_get(x_22, 0);
lean_inc(x_24);
lean_dec_ref(x_22);
x_56 = l_Lake_RegistrySrc_fromJson_x3f___closed__7;
x_57 = l_Lake_JsonObject_getJson_x3f(x_9, x_56);
if (lean_obj_tag(x_57) == 0)
{
lean_object* x_58; 
x_58 = lean_box(0);
x_44 = x_58;
goto block_55;
}
else
{
lean_object* x_59; lean_object* x_60; 
x_59 = lean_ctor_get(x_57, 0);
lean_inc(x_59);
lean_dec_ref(x_57);
x_60 = l_Option_fromJson_x3f___at___00Lake_RegistrySrc_fromJson_x3f_spec__0(x_59);
if (lean_obj_tag(x_60) == 0)
{
lean_object* x_61; lean_object* x_62; lean_object* x_63; 
lean_dec(x_24);
lean_dec(x_23);
lean_dec(x_9);
x_61 = lean_ctor_get(x_60, 0);
lean_inc(x_61);
lean_dec_ref(x_60);
x_62 = l_Lake_RegistrySrc_fromJson_x3f___closed__8;
x_63 = lean_string_append(x_62, x_61);
lean_dec(x_61);
x_2 = x_63;
goto block_6;
}
else
{
if (lean_obj_tag(x_60) == 0)
{
lean_object* x_64; 
lean_dec(x_24);
lean_dec(x_23);
lean_dec(x_9);
x_64 = lean_ctor_get(x_60, 0);
lean_inc(x_64);
lean_dec_ref(x_60);
x_2 = x_64;
goto block_6;
}
else
{
lean_object* x_65; 
x_65 = lean_ctor_get(x_60, 0);
lean_inc(x_65);
lean_dec_ref(x_60);
if (lean_obj_tag(x_65) == 0)
{
x_44 = x_65;
goto block_55;
}
else
{
lean_object* x_66; lean_object* x_67; uint8_t x_68; 
x_66 = lean_ctor_get(x_65, 0);
lean_inc(x_66);
lean_dec_ref(x_65);
x_67 = l_Lake_RegistrySrc_fromJson_x3f___closed__9;
x_68 = lean_string_dec_eq(x_66, x_67);
lean_dec(x_66);
if (x_68 == 0)
{
lean_object* x_69; 
x_69 = lean_box(0);
x_44 = x_69;
goto block_55;
}
else
{
lean_object* x_70; lean_object* x_71; 
x_70 = l_Lake_RegistrySrc_fromJson_x3f___closed__10;
x_71 = l_Lake_JsonObject_getJson_x3f(x_9, x_70);
if (lean_obj_tag(x_71) == 0)
{
lean_object* x_72; 
x_72 = lean_box(0);
x_44 = x_72;
goto block_55;
}
else
{
lean_object* x_73; lean_object* x_74; 
x_73 = lean_ctor_get(x_71, 0);
lean_inc(x_73);
lean_dec_ref(x_71);
x_74 = l_Option_fromJson_x3f___at___00Lake_RegistrySrc_fromJson_x3f_spec__0(x_73);
if (lean_obj_tag(x_74) == 0)
{
lean_object* x_75; lean_object* x_76; lean_object* x_77; 
lean_dec(x_24);
lean_dec(x_23);
lean_dec(x_9);
x_75 = lean_ctor_get(x_74, 0);
lean_inc(x_75);
lean_dec_ref(x_74);
x_76 = l_Lake_RegistrySrc_fromJson_x3f___closed__11;
x_77 = lean_string_append(x_76, x_75);
lean_dec(x_75);
x_2 = x_77;
goto block_6;
}
else
{
if (lean_obj_tag(x_74) == 0)
{
lean_object* x_78; 
lean_dec(x_24);
lean_dec(x_23);
lean_dec(x_9);
x_78 = lean_ctor_get(x_74, 0);
lean_inc(x_78);
lean_dec_ref(x_74);
x_2 = x_78;
goto block_6;
}
else
{
lean_object* x_79; 
x_79 = lean_ctor_get(x_74, 0);
lean_inc(x_79);
lean_dec_ref(x_74);
x_44 = x_79;
goto block_55;
}
}
}
}
}
}
}
}
block_30:
{
lean_object* x_28; lean_object* x_29; 
x_28 = lean_alloc_ctor(0, 5, 0);
lean_ctor_set(x_28, 0, x_9);
lean_ctor_set(x_28, 1, x_24);
lean_ctor_set(x_28, 2, x_26);
lean_ctor_set(x_28, 3, x_25);
lean_ctor_set(x_28, 4, x_27);
if (lean_is_scalar(x_23)) {
 x_29 = lean_alloc_ctor(1, 1, 0);
} else {
 x_29 = x_23;
}
lean_ctor_set(x_29, 0, x_28);
return x_29;
}
block_43:
{
lean_object* x_33; lean_object* x_34; 
x_33 = l_Lake_RegistrySrc_fromJson_x3f___closed__3;
x_34 = l_Lake_JsonObject_getJson_x3f(x_9, x_33);
if (lean_obj_tag(x_34) == 0)
{
lean_object* x_35; 
x_35 = lean_box(0);
x_25 = x_32;
x_26 = x_31;
x_27 = x_35;
goto block_30;
}
else
{
lean_object* x_36; lean_object* x_37; 
x_36 = lean_ctor_get(x_34, 0);
lean_inc(x_36);
lean_dec_ref(x_34);
x_37 = l_Option_fromJson_x3f___at___00Lake_RegistrySrc_fromJson_x3f_spec__1(x_36);
if (lean_obj_tag(x_37) == 0)
{
lean_object* x_38; lean_object* x_39; lean_object* x_40; 
lean_dec(x_32);
lean_dec(x_31);
lean_dec(x_24);
lean_dec(x_23);
lean_dec(x_9);
x_38 = lean_ctor_get(x_37, 0);
lean_inc(x_38);
lean_dec_ref(x_37);
x_39 = l_Lake_RegistrySrc_fromJson_x3f___closed__4;
x_40 = lean_string_append(x_39, x_38);
lean_dec(x_38);
x_2 = x_40;
goto block_6;
}
else
{
if (lean_obj_tag(x_37) == 0)
{
lean_object* x_41; 
lean_dec(x_32);
lean_dec(x_31);
lean_dec(x_24);
lean_dec(x_23);
lean_dec(x_9);
x_41 = lean_ctor_get(x_37, 0);
lean_inc(x_41);
lean_dec_ref(x_37);
x_2 = x_41;
goto block_6;
}
else
{
lean_object* x_42; 
x_42 = lean_ctor_get(x_37, 0);
lean_inc(x_42);
lean_dec_ref(x_37);
x_25 = x_32;
x_26 = x_31;
x_27 = x_42;
goto block_30;
}
}
}
}
block_55:
{
lean_object* x_45; lean_object* x_46; 
x_45 = l_Lake_RegistrySrc_fromJson_x3f___closed__5;
x_46 = l_Lake_JsonObject_getJson_x3f(x_9, x_45);
if (lean_obj_tag(x_46) == 0)
{
lean_object* x_47; 
x_47 = lean_box(0);
x_31 = x_44;
x_32 = x_47;
goto block_43;
}
else
{
lean_object* x_48; lean_object* x_49; 
x_48 = lean_ctor_get(x_46, 0);
lean_inc(x_48);
lean_dec_ref(x_46);
x_49 = l_Option_fromJson_x3f___at___00Lake_RegistrySrc_fromJson_x3f_spec__0(x_48);
if (lean_obj_tag(x_49) == 0)
{
lean_object* x_50; lean_object* x_51; lean_object* x_52; 
lean_dec(x_44);
lean_dec(x_24);
lean_dec(x_23);
lean_dec(x_9);
x_50 = lean_ctor_get(x_49, 0);
lean_inc(x_50);
lean_dec_ref(x_49);
x_51 = l_Lake_RegistrySrc_fromJson_x3f___closed__6;
x_52 = lean_string_append(x_51, x_50);
lean_dec(x_50);
x_2 = x_52;
goto block_6;
}
else
{
if (lean_obj_tag(x_49) == 0)
{
lean_object* x_53; 
lean_dec(x_44);
lean_dec(x_24);
lean_dec(x_23);
lean_dec(x_9);
x_53 = lean_ctor_get(x_49, 0);
lean_inc(x_53);
lean_dec_ref(x_49);
x_2 = x_53;
goto block_6;
}
else
{
lean_object* x_54; 
x_54 = lean_ctor_get(x_49, 0);
lean_inc(x_54);
lean_dec_ref(x_49);
x_31 = x_44;
x_32 = x_54;
goto block_43;
}
}
}
}
}
else
{
lean_dec(x_23);
lean_dec(x_22);
goto block_13;
}
}
}
}
block_13:
{
lean_object* x_11; lean_object* x_12; 
x_11 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_11, 0, x_9);
if (lean_is_scalar(x_10)) {
 x_12 = lean_alloc_ctor(1, 1, 0);
} else {
 x_12 = x_10;
}
lean_ctor_set(x_12, 0, x_11);
return x_12;
}
}
block_6:
{
lean_object* x_3; lean_object* x_4; lean_object* x_5; 
x_3 = l_Lake_RegistrySrc_fromJson_x3f___closed__0;
x_4 = lean_string_append(x_3, x_2);
lean_dec_ref(x_2);
x_5 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_5, 0, x_4);
return x_5;
}
}
}
static lean_object* _init_l_Lake_RegistrySrc_instFromJson___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = lean_alloc_closure((void*)(l_Lake_RegistrySrc_fromJson_x3f), 1, 0);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistrySrc_instFromJson() {
_start:
{
lean_object* x_1; 
x_1 = l_Lake_RegistrySrc_instFromJson___closed__0;
return x_1;
}
}
static lean_object* _init_l_Lake_instInhabitedRegistryPkg_default___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = l_Array_empty(lean_box(0));
return x_1;
}
}
static lean_object* _init_l_Lake_instInhabitedRegistryPkg_default___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
x_1 = lean_box(0);
x_2 = l_Lake_instInhabitedRegistryPkg_default___closed__0;
x_3 = l_Lake_instInhabitedRegistrySrc_default___closed__0;
x_4 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_4, 0, x_3);
lean_ctor_set(x_4, 1, x_3);
lean_ctor_set(x_4, 2, x_2);
lean_ctor_set(x_4, 3, x_1);
return x_4;
}
}
static lean_object* _init_l_Lake_instInhabitedRegistryPkg_default() {
_start:
{
lean_object* x_1; 
x_1 = l_Lake_instInhabitedRegistryPkg_default___closed__1;
return x_1;
}
}
static lean_object* _init_l_Lake_instInhabitedRegistryPkg() {
_start:
{
lean_object* x_1; 
x_1 = l_Lake_instInhabitedRegistryPkg_default;
return x_1;
}
}
static lean_object* _init_l_Lake_RegistryPkg_gitSrc_x3f___closed__0() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = lean_box(0);
x_2 = lean_box(0);
x_3 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_3, 0, x_2);
lean_ctor_set(x_3, 1, x_1);
return x_3;
}
}
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00Lake_RegistryPkg_gitSrc_x3f_spec__0(lean_object* x_1, lean_object* x_2, lean_object* x_3, size_t x_4, size_t x_5, lean_object* x_6) {
_start:
{
uint8_t x_7; 
x_7 = lean_usize_dec_lt(x_5, x_4);
if (x_7 == 0)
{
lean_inc_ref(x_6);
return x_6;
}
else
{
lean_object* x_8; uint8_t x_9; 
x_8 = lean_array_uget(x_3, x_5);
x_9 = l_Lake_RegistrySrc_isGit(x_8);
if (x_9 == 0)
{
size_t x_10; size_t x_11; 
lean_dec(x_8);
x_10 = 1;
x_11 = lean_usize_add(x_5, x_10);
{
size_t _tmp_4 = x_11;
lean_object* _tmp_5 = x_1;
x_5 = _tmp_4;
x_6 = _tmp_5;
}
goto _start;
}
else
{
lean_object* x_13; lean_object* x_14; lean_object* x_15; 
x_13 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_13, 0, x_8);
x_14 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_14, 0, x_13);
x_15 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_15, 0, x_14);
lean_ctor_set(x_15, 1, x_2);
return x_15;
}
}
}
}
LEAN_EXPORT lean_object* l_Lake_RegistryPkg_gitSrc_x3f(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; size_t x_6; size_t x_7; lean_object* x_8; lean_object* x_9; 
x_2 = lean_ctor_get(x_1, 2);
x_3 = lean_box(0);
x_4 = lean_box(0);
x_5 = l_Lake_RegistryPkg_gitSrc_x3f___closed__0;
x_6 = lean_array_size(x_2);
x_7 = 0;
x_8 = l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00Lake_RegistryPkg_gitSrc_x3f_spec__0(x_5, x_4, x_2, x_6, x_7, x_5);
x_9 = lean_ctor_get(x_8, 0);
lean_inc(x_9);
lean_dec_ref(x_8);
if (lean_obj_tag(x_9) == 0)
{
return x_3;
}
else
{
lean_object* x_10; 
x_10 = lean_ctor_get(x_9, 0);
lean_inc(x_10);
lean_dec_ref(x_9);
return x_10;
}
}
}
LEAN_EXPORT lean_object* l_Lake_RegistryPkg_gitSrc_x3f___boxed(lean_object* x_1) {
_start:
{
lean_object* x_2; 
x_2 = l_Lake_RegistryPkg_gitSrc_x3f(x_1);
lean_dec_ref(x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00Lake_RegistryPkg_gitSrc_x3f_spec__0___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) {
_start:
{
size_t x_7; size_t x_8; lean_object* x_9; 
x_7 = lean_unbox_usize(x_4);
lean_dec(x_4);
x_8 = lean_unbox_usize(x_5);
lean_dec(x_5);
x_9 = l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00Lake_RegistryPkg_gitSrc_x3f_spec__0(x_1, x_2, x_3, x_7, x_8, x_6);
lean_dec_ref(x_6);
lean_dec_ref(x_3);
lean_dec_ref(x_1);
return x_9;
}
}
LEAN_EXPORT lean_object* l_Lake_RegistryPkg_toJson(lean_object* x_1) {
_start:
{
lean_object* x_2; 
x_2 = lean_ctor_get(x_1, 3);
lean_inc(x_2);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lake_RegistryPkg_toJson___boxed(lean_object* x_1) {
_start:
{
lean_object* x_2; 
x_2 = l_Lake_RegistryPkg_toJson(x_1);
lean_dec_ref(x_1);
return x_2;
}
}
static lean_object* _init_l___private_Lake_Reservoir_0__Lake_RegistryPkg_instToJson___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = lean_alloc_closure((void*)(l_Lake_RegistryPkg_toJson___boxed), 1, 0);
return x_1;
}
}
static lean_object* _init_l___private_Lake_Reservoir_0__Lake_RegistryPkg_instToJson() {
_start:
{
lean_object* x_1; 
x_1 = l___private_Lake_Reservoir_0__Lake_RegistryPkg_instToJson___closed__0;
return x_1;
}
}
static lean_object* _init_l_Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1___closed__0() {
_start:
{
lean_object* x_1; lean_object* x_2; 
x_1 = lean_box(0);
x_2 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_mapMUnsafe_map___at___00Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1_spec__1(size_t x_1, size_t x_2, lean_object* x_3) {
_start:
{
uint8_t x_4; 
x_4 = lean_usize_dec_lt(x_2, x_1);
if (x_4 == 0)
{
lean_object* x_5; 
x_5 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_5, 0, x_3);
return x_5;
}
else
{
lean_object* x_6; lean_object* x_7; lean_object* x_8; size_t x_9; size_t x_10; lean_object* x_11; 
x_6 = lean_array_uget(x_3, x_2);
x_7 = lean_unsigned_to_nat(0u);
x_8 = lean_array_uset(x_3, x_2, x_7);
x_9 = 1;
x_10 = lean_usize_add(x_2, x_9);
x_11 = lean_array_uset(x_8, x_2, x_6);
x_2 = x_10;
x_3 = x_11;
goto _start;
}
}
}
static lean_object* _init_l_Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("expected JSON array, got '", 26, 26);
return x_1;
}
}
static lean_object* _init_l_Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1___closed__1() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("'", 1, 1);
return x_1;
}
}
LEAN_EXPORT lean_object* l_Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1(lean_object* x_1) {
_start:
{
if (lean_obj_tag(x_1) == 4)
{
lean_object* x_2; size_t x_3; size_t x_4; lean_object* x_5; 
x_2 = lean_ctor_get(x_1, 0);
lean_inc_ref(x_2);
lean_dec_ref(x_1);
x_3 = lean_array_size(x_2);
x_4 = 0;
x_5 = l___private_Init_Data_Array_Basic_0__Array_mapMUnsafe_map___at___00Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1_spec__1(x_3, x_4, x_2);
return x_5;
}
else
{
lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; 
x_6 = l_Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1___closed__0;
x_7 = lean_unsigned_to_nat(80u);
x_8 = l_Lean_Json_pretty(x_1, x_7);
x_9 = lean_string_append(x_6, x_8);
lean_dec_ref(x_8);
x_10 = l_Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1___closed__1;
x_11 = lean_string_append(x_9, x_10);
x_12 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_12, 0, x_11);
return x_12;
}
}
}
LEAN_EXPORT lean_object* l_Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1(lean_object* x_1) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
lean_object* x_2; 
x_2 = l_Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1___closed__0;
return x_2;
}
else
{
lean_object* x_3; 
x_3 = l_Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1(x_1);
if (lean_obj_tag(x_3) == 0)
{
uint8_t x_4; 
x_4 = !lean_is_exclusive(x_3);
if (x_4 == 0)
{
return x_3;
}
else
{
lean_object* x_5; lean_object* x_6; 
x_5 = lean_ctor_get(x_3, 0);
lean_inc(x_5);
lean_dec(x_3);
x_6 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_6, 0, x_5);
return x_6;
}
}
else
{
uint8_t x_7; 
x_7 = !lean_is_exclusive(x_3);
if (x_7 == 0)
{
lean_object* x_8; lean_object* x_9; 
x_8 = lean_ctor_get(x_3, 0);
x_9 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_9, 0, x_8);
lean_ctor_set(x_3, 0, x_9);
return x_3;
}
else
{
lean_object* x_10; lean_object* x_11; lean_object* x_12; 
x_10 = lean_ctor_get(x_3, 0);
lean_inc(x_10);
lean_dec(x_3);
x_11 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_11, 0, x_10);
x_12 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_12, 0, x_11);
return x_12;
}
}
}
}
}
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_mapMUnsafe_map___at___00Lake_RegistryPkg_fromJson_x3f_spec__0(size_t x_1, size_t x_2, lean_object* x_3) {
_start:
{
uint8_t x_4; 
x_4 = lean_usize_dec_lt(x_2, x_1);
if (x_4 == 0)
{
lean_object* x_5; 
x_5 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_5, 0, x_3);
return x_5;
}
else
{
lean_object* x_6; lean_object* x_7; 
x_6 = lean_array_uget(x_3, x_2);
x_7 = l_Lake_RegistrySrc_fromJson_x3f(x_6);
if (lean_obj_tag(x_7) == 0)
{
uint8_t x_8; 
lean_dec_ref(x_3);
x_8 = !lean_is_exclusive(x_7);
if (x_8 == 0)
{
return x_7;
}
else
{
lean_object* x_9; lean_object* x_10; 
x_9 = lean_ctor_get(x_7, 0);
lean_inc(x_9);
lean_dec(x_7);
x_10 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_10, 0, x_9);
return x_10;
}
}
else
{
lean_object* x_11; lean_object* x_12; lean_object* x_13; size_t x_14; size_t x_15; lean_object* x_16; 
x_11 = lean_ctor_get(x_7, 0);
lean_inc(x_11);
lean_dec_ref(x_7);
x_12 = lean_unsigned_to_nat(0u);
x_13 = lean_array_uset(x_3, x_2, x_12);
x_14 = 1;
x_15 = lean_usize_add(x_2, x_14);
x_16 = lean_array_uset(x_13, x_2, x_11);
x_2 = x_15;
x_3 = x_16;
goto _start;
}
}
}
}
static lean_object* _init_l_Lake_RegistryPkg_fromJson_x3f___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("invalid registry package: ", 26, 26);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistryPkg_fromJson_x3f___closed__1() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("name", 4, 4);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistryPkg_fromJson_x3f___closed__2() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("property not found: name", 24, 24);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistryPkg_fromJson_x3f___closed__3() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("name: ", 6, 6);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistryPkg_fromJson_x3f___closed__4() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("fullName", 8, 8);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistryPkg_fromJson_x3f___closed__5() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("property not found: fullName", 28, 28);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistryPkg_fromJson_x3f___closed__6() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("fullName: ", 10, 10);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistryPkg_fromJson_x3f___closed__7() {
_start:
{
lean_object* x_1; lean_object* x_2; 
x_1 = lean_unsigned_to_nat(0u);
x_2 = lean_mk_empty_array_with_capacity(x_1);
return x_2;
}
}
static lean_object* _init_l_Lake_RegistryPkg_fromJson_x3f___closed__8() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("sources", 7, 7);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistryPkg_fromJson_x3f___closed__9() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("sources: ", 9, 9);
return x_1;
}
}
LEAN_EXPORT lean_object* l_Lake_RegistryPkg_fromJson_x3f(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_7; 
x_7 = l_Lean_Json_getObj_x3f(x_1);
if (lean_obj_tag(x_7) == 0)
{
lean_object* x_8; 
x_8 = lean_ctor_get(x_7, 0);
lean_inc(x_8);
lean_dec_ref(x_7);
x_2 = x_8;
goto block_6;
}
else
{
lean_object* x_9; lean_object* x_10; lean_object* x_11; 
x_9 = lean_ctor_get(x_7, 0);
lean_inc(x_9);
lean_dec_ref(x_7);
x_10 = l_Lake_RegistryPkg_fromJson_x3f___closed__1;
x_11 = l_Lake_JsonObject_getJson_x3f(x_9, x_10);
if (lean_obj_tag(x_11) == 0)
{
lean_object* x_12; 
lean_dec(x_9);
x_12 = l_Lake_RegistryPkg_fromJson_x3f___closed__2;
x_2 = x_12;
goto block_6;
}
else
{
lean_object* x_13; lean_object* x_14; 
x_13 = lean_ctor_get(x_11, 0);
lean_inc(x_13);
lean_dec_ref(x_11);
x_14 = l_Lean_Json_getStr_x3f(x_13);
if (lean_obj_tag(x_14) == 0)
{
lean_object* x_15; lean_object* x_16; lean_object* x_17; 
lean_dec(x_9);
x_15 = lean_ctor_get(x_14, 0);
lean_inc(x_15);
lean_dec_ref(x_14);
x_16 = l_Lake_RegistryPkg_fromJson_x3f___closed__3;
x_17 = lean_string_append(x_16, x_15);
lean_dec(x_15);
x_2 = x_17;
goto block_6;
}
else
{
if (lean_obj_tag(x_14) == 0)
{
lean_object* x_18; 
lean_dec(x_9);
x_18 = lean_ctor_get(x_14, 0);
lean_inc(x_18);
lean_dec_ref(x_14);
x_2 = x_18;
goto block_6;
}
else
{
lean_object* x_19; lean_object* x_20; lean_object* x_21; 
x_19 = lean_ctor_get(x_14, 0);
lean_inc(x_19);
lean_dec_ref(x_14);
x_20 = l_Lake_RegistryPkg_fromJson_x3f___closed__4;
x_21 = l_Lake_JsonObject_getJson_x3f(x_9, x_20);
if (lean_obj_tag(x_21) == 0)
{
lean_object* x_22; 
lean_dec(x_19);
lean_dec(x_9);
x_22 = l_Lake_RegistryPkg_fromJson_x3f___closed__5;
x_2 = x_22;
goto block_6;
}
else
{
lean_object* x_23; lean_object* x_24; 
x_23 = lean_ctor_get(x_21, 0);
lean_inc(x_23);
lean_dec_ref(x_21);
x_24 = l_Lean_Json_getStr_x3f(x_23);
if (lean_obj_tag(x_24) == 0)
{
lean_object* x_25; lean_object* x_26; lean_object* x_27; 
lean_dec(x_19);
lean_dec(x_9);
x_25 = lean_ctor_get(x_24, 0);
lean_inc(x_25);
lean_dec_ref(x_24);
x_26 = l_Lake_RegistryPkg_fromJson_x3f___closed__6;
x_27 = lean_string_append(x_26, x_25);
lean_dec(x_25);
x_2 = x_27;
goto block_6;
}
else
{
if (lean_obj_tag(x_24) == 0)
{
lean_object* x_28; 
lean_dec(x_19);
lean_dec(x_9);
x_28 = lean_ctor_get(x_24, 0);
lean_inc(x_28);
lean_dec_ref(x_24);
x_2 = x_28;
goto block_6;
}
else
{
lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_47; lean_object* x_48; 
x_29 = lean_ctor_get(x_24, 0);
lean_inc(x_29);
if (lean_is_exclusive(x_24)) {
 lean_ctor_release(x_24, 0);
 x_30 = x_24;
} else {
 lean_dec_ref(x_24);
 x_30 = lean_box(0);
}
x_47 = l_Lake_RegistryPkg_fromJson_x3f___closed__8;
x_48 = l_Lake_JsonObject_getJson_x3f(x_9, x_47);
if (lean_obj_tag(x_48) == 0)
{
goto block_46;
}
else
{
lean_object* x_49; lean_object* x_50; 
x_49 = lean_ctor_get(x_48, 0);
lean_inc(x_49);
lean_dec_ref(x_48);
x_50 = l_Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1(x_49);
if (lean_obj_tag(x_50) == 0)
{
lean_object* x_51; lean_object* x_52; lean_object* x_53; 
lean_dec(x_30);
lean_dec(x_29);
lean_dec(x_19);
lean_dec(x_9);
x_51 = lean_ctor_get(x_50, 0);
lean_inc(x_51);
lean_dec_ref(x_50);
x_52 = l_Lake_RegistryPkg_fromJson_x3f___closed__9;
x_53 = lean_string_append(x_52, x_51);
lean_dec(x_51);
x_2 = x_53;
goto block_6;
}
else
{
if (lean_obj_tag(x_50) == 0)
{
lean_object* x_54; 
lean_dec(x_30);
lean_dec(x_29);
lean_dec(x_19);
lean_dec(x_9);
x_54 = lean_ctor_get(x_50, 0);
lean_inc(x_54);
lean_dec_ref(x_50);
x_2 = x_54;
goto block_6;
}
else
{
lean_object* x_55; 
x_55 = lean_ctor_get(x_50, 0);
lean_inc(x_55);
lean_dec_ref(x_50);
if (lean_obj_tag(x_55) == 0)
{
goto block_46;
}
else
{
lean_object* x_56; 
x_56 = lean_ctor_get(x_55, 0);
lean_inc(x_56);
lean_dec_ref(x_55);
x_31 = x_56;
goto block_44;
}
}
}
}
block_44:
{
size_t x_32; size_t x_33; lean_object* x_34; 
x_32 = lean_array_size(x_31);
x_33 = 0;
x_34 = l___private_Init_Data_Array_Basic_0__Array_mapMUnsafe_map___at___00Lake_RegistryPkg_fromJson_x3f_spec__0(x_32, x_33, x_31);
if (lean_obj_tag(x_34) == 0)
{
lean_object* x_35; 
lean_dec(x_30);
lean_dec(x_29);
lean_dec(x_19);
lean_dec(x_9);
x_35 = lean_ctor_get(x_34, 0);
lean_inc(x_35);
lean_dec_ref(x_34);
x_2 = x_35;
goto block_6;
}
else
{
uint8_t x_36; 
x_36 = !lean_is_exclusive(x_34);
if (x_36 == 0)
{
lean_object* x_37; lean_object* x_38; lean_object* x_39; 
x_37 = lean_ctor_get(x_34, 0);
if (lean_is_scalar(x_30)) {
 x_38 = lean_alloc_ctor(5, 1, 0);
} else {
 x_38 = x_30;
 lean_ctor_set_tag(x_38, 5);
}
lean_ctor_set(x_38, 0, x_9);
x_39 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_39, 0, x_19);
lean_ctor_set(x_39, 1, x_29);
lean_ctor_set(x_39, 2, x_37);
lean_ctor_set(x_39, 3, x_38);
lean_ctor_set(x_34, 0, x_39);
return x_34;
}
else
{
lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; 
x_40 = lean_ctor_get(x_34, 0);
lean_inc(x_40);
lean_dec(x_34);
if (lean_is_scalar(x_30)) {
 x_41 = lean_alloc_ctor(5, 1, 0);
} else {
 x_41 = x_30;
 lean_ctor_set_tag(x_41, 5);
}
lean_ctor_set(x_41, 0, x_9);
x_42 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_42, 0, x_19);
lean_ctor_set(x_42, 1, x_29);
lean_ctor_set(x_42, 2, x_40);
lean_ctor_set(x_42, 3, x_41);
x_43 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_43, 0, x_42);
return x_43;
}
}
}
block_46:
{
lean_object* x_45; 
x_45 = l_Lake_RegistryPkg_fromJson_x3f___closed__7;
x_31 = x_45;
goto block_44;
}
}
}
}
}
}
}
}
block_6:
{
lean_object* x_3; lean_object* x_4; lean_object* x_5; 
x_3 = l_Lake_RegistryPkg_fromJson_x3f___closed__0;
x_4 = lean_string_append(x_3, x_2);
lean_dec_ref(x_2);
x_5 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_5, 0, x_4);
return x_5;
}
}
}
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_mapMUnsafe_map___at___00Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1_spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
size_t x_4; size_t x_5; lean_object* x_6; 
x_4 = lean_unbox_usize(x_1);
lean_dec(x_1);
x_5 = lean_unbox_usize(x_2);
lean_dec(x_2);
x_6 = l___private_Init_Data_Array_Basic_0__Array_mapMUnsafe_map___at___00Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1_spec__1(x_4, x_5, x_3);
return x_6;
}
}
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_mapMUnsafe_map___at___00Lake_RegistryPkg_fromJson_x3f_spec__0___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
size_t x_4; size_t x_5; lean_object* x_6; 
x_4 = lean_unbox_usize(x_1);
lean_dec(x_1);
x_5 = lean_unbox_usize(x_2);
lean_dec(x_2);
x_6 = l___private_Init_Data_Array_Basic_0__Array_mapMUnsafe_map___at___00Lake_RegistryPkg_fromJson_x3f_spec__0(x_4, x_5, x_3);
return x_6;
}
}
static lean_object* _init_l_Lake_RegistryPkg_instFromJson___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = lean_alloc_closure((void*)(l_Lake_RegistryPkg_fromJson_x3f), 1, 0);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistryPkg_instFromJson() {
_start:
{
lean_object* x_1; 
x_1 = l_Lake_RegistryPkg_instFromJson___closed__0;
return x_1;
}
}
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_ctorIdx___redArg(lean_object* x_1) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
lean_object* x_2; 
x_2 = lean_unsigned_to_nat(0u);
return x_2;
}
else
{
lean_object* x_3; 
x_3 = lean_unsigned_to_nat(1u);
return x_3;
}
}
}
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_ctorIdx(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; 
x_3 = l_Lake_ReservoirResp_ctorIdx___redArg(x_2);
return x_3;
}
}
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_ctorIdx___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; 
x_3 = l_Lake_ReservoirResp_ctorIdx(x_1, x_2);
lean_dec_ref(x_2);
return x_3;
}
}
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_ctorIdx___redArg___boxed(lean_object* x_1) {
_start:
{
lean_object* x_2; 
x_2 = l_Lake_ReservoirResp_ctorIdx___redArg(x_1);
lean_dec_ref(x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_ctorElim___redArg(lean_object* x_1, lean_object* x_2) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
lean_object* x_3; lean_object* x_4; 
x_3 = lean_ctor_get(x_1, 0);
lean_inc(x_3);
lean_dec_ref(x_1);
x_4 = lean_apply_1(x_2, x_3);
return x_4;
}
else
{
lean_object* x_5; lean_object* x_6; lean_object* x_7; 
x_5 = lean_ctor_get(x_1, 0);
lean_inc(x_5);
x_6 = lean_ctor_get(x_1, 1);
lean_inc_ref(x_6);
lean_dec_ref(x_1);
x_7 = lean_apply_2(x_2, x_5, x_6);
return x_7;
}
}
}
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_ctorElim(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) {
_start:
{
lean_object* x_7; 
x_7 = l_Lake_ReservoirResp_ctorElim___redArg(x_4, x_6);
return x_7;
}
}
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_ctorElim___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) {
_start:
{
lean_object* x_7; 
x_7 = l_Lake_ReservoirResp_ctorElim(x_1, x_2, x_3, x_4, x_5, x_6);
lean_dec(x_3);
return x_7;
}
}
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_data_elim(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
lean_object* x_6; 
x_6 = l_Lake_ReservoirResp_ctorElim___redArg(x_3, x_5);
return x_6;
}
}
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_data_elim___redArg(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; 
x_3 = l_Lake_ReservoirResp_ctorElim___redArg(x_1, x_2);
return x_3;
}
}
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_error_elim(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
lean_object* x_6; 
x_6 = l_Lake_ReservoirResp_ctorElim___redArg(x_3, x_5);
return x_6;
}
}
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_error_elim___redArg(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; 
x_3 = l_Lake_ReservoirResp_ctorElim___redArg(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = lean_alloc_closure((void*)(l_Lean_instFromJsonJson___lam__0), 1, 0);
return x_1;
}
}
static lean_object* _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__1() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("data", 4, 4);
return x_1;
}
}
static lean_object* _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__2() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("data: ", 6, 6);
return x_1;
}
}
static lean_object* _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__3() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("error", 5, 5);
return x_1;
}
}
static lean_object* _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__4() {
_start:
{
lean_object* x_1; 
x_1 = lean_alloc_closure((void*)(l_Lake_JsonObject_fromJson_x3f), 1, 0);
return x_1;
}
}
static lean_object* _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__5() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("error: ", 7, 7);
return x_1;
}
}
static lean_object* _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__6() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("status", 6, 6);
return x_1;
}
}
static lean_object* _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__7() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("property not found: status", 26, 26);
return x_1;
}
}
static lean_object* _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__8() {
_start:
{
lean_object* x_1; lean_object* x_2; 
x_1 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__7;
x_2 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
static lean_object* _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__9() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("status: ", 8, 8);
return x_1;
}
}
static lean_object* _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__10() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("message", 7, 7);
return x_1;
}
}
static lean_object* _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__11() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("property not found: message", 27, 27);
return x_1;
}
}
static lean_object* _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__12() {
_start:
{
lean_object* x_1; lean_object* x_2; 
x_1 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__11;
x_2 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
static lean_object* _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__13() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("message: ", 9, 9);
return x_1;
}
}
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_fromJson_x3f___redArg(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; lean_object* x_34; 
lean_inc(x_2);
x_34 = l_Lean_Json_getObj_x3f(x_2);
if (lean_obj_tag(x_34) == 0)
{
uint8_t x_35; 
lean_dec(x_2);
lean_dec_ref(x_1);
x_35 = !lean_is_exclusive(x_34);
if (x_35 == 0)
{
return x_34;
}
else
{
lean_object* x_36; lean_object* x_37; 
x_36 = lean_ctor_get(x_34, 0);
lean_inc(x_36);
lean_dec(x_34);
x_37 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_37, 0, x_36);
return x_37;
}
}
else
{
lean_object* x_38; lean_object* x_39; lean_object* x_57; lean_object* x_58; 
x_38 = lean_ctor_get(x_34, 0);
lean_inc(x_38);
lean_dec_ref(x_34);
x_39 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__0;
x_57 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__3;
x_58 = l_Lake_JsonObject_getJson_x3f(x_38, x_57);
if (lean_obj_tag(x_58) == 0)
{
goto block_56;
}
else
{
lean_object* x_59; lean_object* x_60; lean_object* x_61; 
x_59 = lean_ctor_get(x_58, 0);
lean_inc(x_59);
lean_dec_ref(x_58);
x_60 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__4;
x_61 = l_Option_fromJson_x3f___redArg(x_60, x_59);
if (lean_obj_tag(x_61) == 0)
{
uint8_t x_62; 
lean_dec(x_38);
lean_dec(x_2);
lean_dec_ref(x_1);
x_62 = !lean_is_exclusive(x_61);
if (x_62 == 0)
{
lean_object* x_63; lean_object* x_64; lean_object* x_65; 
x_63 = lean_ctor_get(x_61, 0);
x_64 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__5;
x_65 = lean_string_append(x_64, x_63);
lean_dec(x_63);
lean_ctor_set(x_61, 0, x_65);
return x_61;
}
else
{
lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; 
x_66 = lean_ctor_get(x_61, 0);
lean_inc(x_66);
lean_dec(x_61);
x_67 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__5;
x_68 = lean_string_append(x_67, x_66);
lean_dec(x_66);
x_69 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_69, 0, x_68);
return x_69;
}
}
else
{
if (lean_obj_tag(x_61) == 0)
{
uint8_t x_70; 
lean_dec(x_38);
lean_dec(x_2);
lean_dec_ref(x_1);
x_70 = !lean_is_exclusive(x_61);
if (x_70 == 0)
{
lean_ctor_set_tag(x_61, 0);
return x_61;
}
else
{
lean_object* x_71; lean_object* x_72; 
x_71 = lean_ctor_get(x_61, 0);
lean_inc(x_71);
lean_dec(x_61);
x_72 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_72, 0, x_71);
return x_72;
}
}
else
{
lean_object* x_73; 
x_73 = lean_ctor_get(x_61, 0);
lean_inc(x_73);
lean_dec_ref(x_61);
if (lean_obj_tag(x_73) == 1)
{
lean_object* x_74; lean_object* x_75; lean_object* x_76; 
lean_dec(x_38);
lean_dec(x_2);
lean_dec_ref(x_1);
x_74 = lean_ctor_get(x_73, 0);
lean_inc(x_74);
lean_dec_ref(x_73);
x_75 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__6;
x_76 = l_Lake_JsonObject_getJson_x3f(x_74, x_75);
if (lean_obj_tag(x_76) == 0)
{
lean_object* x_77; 
lean_dec(x_74);
x_77 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__8;
return x_77;
}
else
{
lean_object* x_78; lean_object* x_79; 
x_78 = lean_ctor_get(x_76, 0);
lean_inc(x_78);
lean_dec_ref(x_76);
x_79 = l_Lean_Json_getNat_x3f(x_78);
if (lean_obj_tag(x_79) == 0)
{
uint8_t x_80; 
lean_dec(x_74);
x_80 = !lean_is_exclusive(x_79);
if (x_80 == 0)
{
lean_object* x_81; lean_object* x_82; lean_object* x_83; 
x_81 = lean_ctor_get(x_79, 0);
x_82 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__9;
x_83 = lean_string_append(x_82, x_81);
lean_dec(x_81);
lean_ctor_set(x_79, 0, x_83);
return x_79;
}
else
{
lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; 
x_84 = lean_ctor_get(x_79, 0);
lean_inc(x_84);
lean_dec(x_79);
x_85 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__9;
x_86 = lean_string_append(x_85, x_84);
lean_dec(x_84);
x_87 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_87, 0, x_86);
return x_87;
}
}
else
{
if (lean_obj_tag(x_79) == 0)
{
uint8_t x_88; 
lean_dec(x_74);
x_88 = !lean_is_exclusive(x_79);
if (x_88 == 0)
{
lean_ctor_set_tag(x_79, 0);
return x_79;
}
else
{
lean_object* x_89; lean_object* x_90; 
x_89 = lean_ctor_get(x_79, 0);
lean_inc(x_89);
lean_dec(x_79);
x_90 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_90, 0, x_89);
return x_90;
}
}
else
{
lean_object* x_91; lean_object* x_92; lean_object* x_93; 
x_91 = lean_ctor_get(x_79, 0);
lean_inc(x_91);
lean_dec_ref(x_79);
x_92 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__10;
x_93 = l_Lake_JsonObject_getJson_x3f(x_74, x_92);
lean_dec(x_74);
if (lean_obj_tag(x_93) == 0)
{
lean_object* x_94; 
lean_dec(x_91);
x_94 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__12;
return x_94;
}
else
{
lean_object* x_95; lean_object* x_96; 
x_95 = lean_ctor_get(x_93, 0);
lean_inc(x_95);
lean_dec_ref(x_93);
x_96 = l_Lean_Json_getStr_x3f(x_95);
if (lean_obj_tag(x_96) == 0)
{
uint8_t x_97; 
lean_dec(x_91);
x_97 = !lean_is_exclusive(x_96);
if (x_97 == 0)
{
lean_object* x_98; lean_object* x_99; lean_object* x_100; 
x_98 = lean_ctor_get(x_96, 0);
x_99 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__13;
x_100 = lean_string_append(x_99, x_98);
lean_dec(x_98);
lean_ctor_set(x_96, 0, x_100);
return x_96;
}
else
{
lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; 
x_101 = lean_ctor_get(x_96, 0);
lean_inc(x_101);
lean_dec(x_96);
x_102 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__13;
x_103 = lean_string_append(x_102, x_101);
lean_dec(x_101);
x_104 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_104, 0, x_103);
return x_104;
}
}
else
{
if (lean_obj_tag(x_96) == 0)
{
uint8_t x_105; 
lean_dec(x_91);
x_105 = !lean_is_exclusive(x_96);
if (x_105 == 0)
{
lean_ctor_set_tag(x_96, 0);
return x_96;
}
else
{
lean_object* x_106; lean_object* x_107; 
x_106 = lean_ctor_get(x_96, 0);
lean_inc(x_106);
lean_dec(x_96);
x_107 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_107, 0, x_106);
return x_107;
}
}
else
{
uint8_t x_108; 
x_108 = !lean_is_exclusive(x_96);
if (x_108 == 0)
{
lean_object* x_109; lean_object* x_110; 
x_109 = lean_ctor_get(x_96, 0);
x_110 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_110, 0, x_91);
lean_ctor_set(x_110, 1, x_109);
lean_ctor_set(x_96, 0, x_110);
return x_96;
}
else
{
lean_object* x_111; lean_object* x_112; lean_object* x_113; 
x_111 = lean_ctor_get(x_96, 0);
lean_inc(x_111);
lean_dec(x_96);
x_112 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_112, 0, x_91);
lean_ctor_set(x_112, 1, x_111);
x_113 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_113, 0, x_112);
return x_113;
}
}
}
}
}
}
}
}
else
{
lean_dec(x_73);
goto block_56;
}
}
}
}
block_56:
{
lean_object* x_40; lean_object* x_41; 
x_40 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__1;
x_41 = l_Lake_JsonObject_getJson_x3f(x_38, x_40);
lean_dec(x_38);
if (lean_obj_tag(x_41) == 0)
{
x_3 = x_41;
goto block_33;
}
else
{
lean_object* x_42; lean_object* x_43; 
x_42 = lean_ctor_get(x_41, 0);
lean_inc(x_42);
lean_dec_ref(x_41);
x_43 = l_Option_fromJson_x3f___redArg(x_39, x_42);
if (lean_obj_tag(x_43) == 0)
{
uint8_t x_44; 
lean_dec(x_2);
lean_dec_ref(x_1);
x_44 = !lean_is_exclusive(x_43);
if (x_44 == 0)
{
lean_object* x_45; lean_object* x_46; lean_object* x_47; 
x_45 = lean_ctor_get(x_43, 0);
x_46 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__2;
x_47 = lean_string_append(x_46, x_45);
lean_dec(x_45);
lean_ctor_set(x_43, 0, x_47);
return x_43;
}
else
{
lean_object* x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51; 
x_48 = lean_ctor_get(x_43, 0);
lean_inc(x_48);
lean_dec(x_43);
x_49 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__2;
x_50 = lean_string_append(x_49, x_48);
lean_dec(x_48);
x_51 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_51, 0, x_50);
return x_51;
}
}
else
{
if (lean_obj_tag(x_43) == 0)
{
uint8_t x_52; 
lean_dec(x_2);
lean_dec_ref(x_1);
x_52 = !lean_is_exclusive(x_43);
if (x_52 == 0)
{
lean_ctor_set_tag(x_43, 0);
return x_43;
}
else
{
lean_object* x_53; lean_object* x_54; 
x_53 = lean_ctor_get(x_43, 0);
lean_inc(x_53);
lean_dec(x_43);
x_54 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_54, 0, x_53);
return x_54;
}
}
else
{
lean_object* x_55; 
x_55 = lean_ctor_get(x_43, 0);
lean_inc(x_55);
lean_dec_ref(x_43);
x_3 = x_55;
goto block_33;
}
}
}
}
}
block_33:
{
if (lean_obj_tag(x_3) == 1)
{
uint8_t x_4; 
lean_dec(x_2);
x_4 = !lean_is_exclusive(x_3);
if (x_4 == 0)
{
lean_object* x_5; lean_object* x_6; 
x_5 = lean_ctor_get(x_3, 0);
x_6 = lean_apply_1(x_1, x_5);
if (lean_obj_tag(x_6) == 0)
{
uint8_t x_7; 
lean_free_object(x_3);
x_7 = !lean_is_exclusive(x_6);
if (x_7 == 0)
{
return x_6;
}
else
{
lean_object* x_8; lean_object* x_9; 
x_8 = lean_ctor_get(x_6, 0);
lean_inc(x_8);
lean_dec(x_6);
x_9 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_9, 0, x_8);
return x_9;
}
}
else
{
uint8_t x_10; 
x_10 = !lean_is_exclusive(x_6);
if (x_10 == 0)
{
lean_object* x_11; 
x_11 = lean_ctor_get(x_6, 0);
lean_ctor_set_tag(x_3, 0);
lean_ctor_set(x_3, 0, x_11);
lean_ctor_set(x_6, 0, x_3);
return x_6;
}
else
{
lean_object* x_12; lean_object* x_13; 
x_12 = lean_ctor_get(x_6, 0);
lean_inc(x_12);
lean_dec(x_6);
lean_ctor_set_tag(x_3, 0);
lean_ctor_set(x_3, 0, x_12);
x_13 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_13, 0, x_3);
return x_13;
}
}
}
else
{
lean_object* x_14; lean_object* x_15; 
x_14 = lean_ctor_get(x_3, 0);
lean_inc(x_14);
lean_dec(x_3);
x_15 = lean_apply_1(x_1, x_14);
if (lean_obj_tag(x_15) == 0)
{
lean_object* x_16; lean_object* x_17; lean_object* x_18; 
x_16 = lean_ctor_get(x_15, 0);
lean_inc(x_16);
if (lean_is_exclusive(x_15)) {
 lean_ctor_release(x_15, 0);
 x_17 = x_15;
} else {
 lean_dec_ref(x_15);
 x_17 = lean_box(0);
}
if (lean_is_scalar(x_17)) {
 x_18 = lean_alloc_ctor(0, 1, 0);
} else {
 x_18 = x_17;
}
lean_ctor_set(x_18, 0, x_16);
return x_18;
}
else
{
lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; 
x_19 = lean_ctor_get(x_15, 0);
lean_inc(x_19);
if (lean_is_exclusive(x_15)) {
 lean_ctor_release(x_15, 0);
 x_20 = x_15;
} else {
 lean_dec_ref(x_15);
 x_20 = lean_box(0);
}
x_21 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_21, 0, x_19);
if (lean_is_scalar(x_20)) {
 x_22 = lean_alloc_ctor(1, 1, 0);
} else {
 x_22 = x_20;
}
lean_ctor_set(x_22, 0, x_21);
return x_22;
}
}
}
else
{
lean_object* x_23; 
lean_dec(x_3);
x_23 = lean_apply_1(x_1, x_2);
if (lean_obj_tag(x_23) == 0)
{
uint8_t x_24; 
x_24 = !lean_is_exclusive(x_23);
if (x_24 == 0)
{
return x_23;
}
else
{
lean_object* x_25; lean_object* x_26; 
x_25 = lean_ctor_get(x_23, 0);
lean_inc(x_25);
lean_dec(x_23);
x_26 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_26, 0, x_25);
return x_26;
}
}
else
{
uint8_t x_27; 
x_27 = !lean_is_exclusive(x_23);
if (x_27 == 0)
{
lean_object* x_28; lean_object* x_29; 
x_28 = lean_ctor_get(x_23, 0);
x_29 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_29, 0, x_28);
lean_ctor_set(x_23, 0, x_29);
return x_23;
}
else
{
lean_object* x_30; lean_object* x_31; lean_object* x_32; 
x_30 = lean_ctor_get(x_23, 0);
lean_inc(x_30);
lean_dec(x_23);
x_31 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_31, 0, x_30);
x_32 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_32, 0, x_31);
return x_32;
}
}
}
}
}
}
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_fromJson_x3f(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_4; 
x_4 = l_Lake_ReservoirResp_fromJson_x3f___redArg(x_2, x_3);
return x_4;
}
}
LEAN_EXPORT lean_object* l_Lake_instFromJsonReservoirResp(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; 
x_3 = lean_alloc_closure((void*)(l_Lake_ReservoirResp_fromJson_x3f), 3, 2);
lean_closure_set(x_3, 0, lean_box(0));
lean_closure_set(x_3, 1, x_2);
return x_3;
}
}
LEAN_EXPORT lean_object* l_Lake_instFromJsonReservoirResp___redArg(lean_object* x_1) {
_start:
{
lean_object* x_2; 
x_2 = lean_alloc_closure((void*)(l_Lake_ReservoirResp_fromJson_x3f), 3, 2);
lean_closure_set(x_2, 0, lean_box(0));
lean_closure_set(x_2, 1, x_1);
return x_2;
}
}
static lean_object* _init_l_Lake_Reservoir_pkgApiUrl___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("/packages/", 10, 10);
return x_1;
}
}
static lean_object* _init_l_Lake_Reservoir_pkgApiUrl___closed__1() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("/", 1, 1);
return x_1;
}
}
LEAN_EXPORT lean_object* l_Lake_Reservoir_pkgApiUrl(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; 
x_4 = lean_ctor_get(x_1, 3);
lean_inc_ref(x_4);
lean_dec_ref(x_1);
x_5 = l_Lake_Reservoir_pkgApiUrl___closed__0;
x_6 = lean_string_append(x_4, x_5);
x_7 = l_Lake_instInhabitedRegistrySrc_default___closed__0;
x_8 = l_Lake_uriEncode(x_2, x_7);
x_9 = lean_string_append(x_6, x_8);
lean_dec_ref(x_8);
x_10 = l_Lake_Reservoir_pkgApiUrl___closed__1;
x_11 = lean_string_append(x_9, x_10);
x_12 = l_Lake_uriEncode(x_3, x_7);
x_13 = lean_string_append(x_11, x_12);
lean_dec_ref(x_12);
return x_13;
}
}
static lean_object* _init_l_Option_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0_spec__0___closed__0() {
_start:
{
lean_object* x_1; lean_object* x_2; 
x_1 = lean_box(0);
x_2 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Option_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0_spec__0(lean_object* x_1) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
lean_object* x_2; 
x_2 = l_Option_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0_spec__0___closed__0;
return x_2;
}
else
{
lean_object* x_3; lean_object* x_4; 
x_3 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_3, 0, x_1);
x_4 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_4, 0, x_3);
return x_4;
}
}
}
static lean_object* _init_l_Option_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0_spec__1___closed__0() {
_start:
{
lean_object* x_1; lean_object* x_2; 
x_1 = lean_box(0);
x_2 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Option_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0_spec__1(lean_object* x_1) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
lean_object* x_2; 
x_2 = l_Option_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0_spec__1___closed__0;
return x_2;
}
else
{
lean_object* x_3; 
x_3 = l_Lean_Json_getObj_x3f(x_1);
if (lean_obj_tag(x_3) == 0)
{
uint8_t x_4; 
x_4 = !lean_is_exclusive(x_3);
if (x_4 == 0)
{
return x_3;
}
else
{
lean_object* x_5; lean_object* x_6; 
x_5 = lean_ctor_get(x_3, 0);
lean_inc(x_5);
lean_dec(x_3);
x_6 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_6, 0, x_5);
return x_6;
}
}
else
{
uint8_t x_7; 
x_7 = !lean_is_exclusive(x_3);
if (x_7 == 0)
{
lean_object* x_8; lean_object* x_9; 
x_8 = lean_ctor_get(x_3, 0);
x_9 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_9, 0, x_8);
lean_ctor_set(x_3, 0, x_9);
return x_3;
}
else
{
lean_object* x_10; lean_object* x_11; lean_object* x_12; 
x_10 = lean_ctor_get(x_3, 0);
lean_inc(x_10);
lean_dec(x_3);
x_11 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_11, 0, x_10);
x_12 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_12, 0, x_11);
return x_12;
}
}
}
}
}
static lean_object* _init_l_Lake_Reservoir_fetchPkg_x3f___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = l_Lake_Reservoir_lakeHeaders;
return x_1;
}
}
static lean_object* _init_l_Lake_Reservoir_fetchPkg_x3f___closed__1() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked(": Reservoir lookup failed; server returned invalid JSON: ", 57, 57);
return x_1;
}
}
static lean_object* _init_l_Lake_Reservoir_fetchPkg_x3f___closed__2() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked(": Reservoir responded with:\n", 28, 28);
return x_1;
}
}
static lean_object* _init_l_Lake_Reservoir_fetchPkg_x3f___closed__3() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked(": Reservoir lookup failed; server returned unsupported JSON: ", 61, 61);
return x_1;
}
}
static lean_object* _init_l_Lake_Reservoir_fetchPkg_x3f___closed__4() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked(": Reservoir lookup failed: ", 27, 27);
return x_1;
}
}
static lean_object* _init_l_Lake_Reservoir_fetchPkg_x3f___closed__5() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked(": Reservoir lookup failed", 25, 25);
return x_1;
}
}
static lean_object* _init_l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0___closed__0() {
_start:
{
lean_object* x_1; lean_object* x_2; 
x_1 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__7;
x_2 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
static lean_object* _init_l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2; 
x_1 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__11;
x_2 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_33; 
lean_inc(x_1);
x_33 = l_Lean_Json_getObj_x3f(x_1);
if (lean_obj_tag(x_33) == 0)
{
uint8_t x_34; 
lean_dec(x_1);
x_34 = !lean_is_exclusive(x_33);
if (x_34 == 0)
{
return x_33;
}
else
{
lean_object* x_35; lean_object* x_36; 
x_35 = lean_ctor_get(x_33, 0);
lean_inc(x_35);
lean_dec(x_33);
x_36 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_36, 0, x_35);
return x_36;
}
}
else
{
lean_object* x_37; lean_object* x_44; lean_object* x_45; 
x_37 = lean_ctor_get(x_33, 0);
lean_inc(x_37);
lean_dec_ref(x_33);
x_44 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__3;
x_45 = l_Lake_JsonObject_getJson_x3f(x_37, x_44);
if (lean_obj_tag(x_45) == 0)
{
goto block_43;
}
else
{
lean_object* x_46; lean_object* x_47; 
x_46 = lean_ctor_get(x_45, 0);
lean_inc(x_46);
lean_dec_ref(x_45);
x_47 = l_Option_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0_spec__1(x_46);
if (lean_obj_tag(x_47) == 0)
{
uint8_t x_48; 
lean_dec(x_37);
lean_dec(x_1);
x_48 = !lean_is_exclusive(x_47);
if (x_48 == 0)
{
lean_object* x_49; lean_object* x_50; lean_object* x_51; 
x_49 = lean_ctor_get(x_47, 0);
x_50 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__5;
x_51 = lean_string_append(x_50, x_49);
lean_dec(x_49);
lean_ctor_set(x_47, 0, x_51);
return x_47;
}
else
{
lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; 
x_52 = lean_ctor_get(x_47, 0);
lean_inc(x_52);
lean_dec(x_47);
x_53 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__5;
x_54 = lean_string_append(x_53, x_52);
lean_dec(x_52);
x_55 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_55, 0, x_54);
return x_55;
}
}
else
{
if (lean_obj_tag(x_47) == 0)
{
uint8_t x_56; 
lean_dec(x_37);
lean_dec(x_1);
x_56 = !lean_is_exclusive(x_47);
if (x_56 == 0)
{
lean_ctor_set_tag(x_47, 0);
return x_47;
}
else
{
lean_object* x_57; lean_object* x_58; 
x_57 = lean_ctor_get(x_47, 0);
lean_inc(x_57);
lean_dec(x_47);
x_58 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_58, 0, x_57);
return x_58;
}
}
else
{
lean_object* x_59; 
x_59 = lean_ctor_get(x_47, 0);
lean_inc(x_59);
lean_dec_ref(x_47);
if (lean_obj_tag(x_59) == 1)
{
lean_object* x_60; lean_object* x_61; lean_object* x_62; 
lean_dec(x_37);
lean_dec(x_1);
x_60 = lean_ctor_get(x_59, 0);
lean_inc(x_60);
lean_dec_ref(x_59);
x_61 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__6;
x_62 = l_Lake_JsonObject_getJson_x3f(x_60, x_61);
if (lean_obj_tag(x_62) == 0)
{
lean_object* x_63; 
lean_dec(x_60);
x_63 = l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0___closed__0;
return x_63;
}
else
{
lean_object* x_64; lean_object* x_65; 
x_64 = lean_ctor_get(x_62, 0);
lean_inc(x_64);
lean_dec_ref(x_62);
x_65 = l_Lean_Json_getNat_x3f(x_64);
if (lean_obj_tag(x_65) == 0)
{
uint8_t x_66; 
lean_dec(x_60);
x_66 = !lean_is_exclusive(x_65);
if (x_66 == 0)
{
lean_object* x_67; lean_object* x_68; lean_object* x_69; 
x_67 = lean_ctor_get(x_65, 0);
x_68 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__9;
x_69 = lean_string_append(x_68, x_67);
lean_dec(x_67);
lean_ctor_set(x_65, 0, x_69);
return x_65;
}
else
{
lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; 
x_70 = lean_ctor_get(x_65, 0);
lean_inc(x_70);
lean_dec(x_65);
x_71 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__9;
x_72 = lean_string_append(x_71, x_70);
lean_dec(x_70);
x_73 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_73, 0, x_72);
return x_73;
}
}
else
{
if (lean_obj_tag(x_65) == 0)
{
uint8_t x_74; 
lean_dec(x_60);
x_74 = !lean_is_exclusive(x_65);
if (x_74 == 0)
{
lean_ctor_set_tag(x_65, 0);
return x_65;
}
else
{
lean_object* x_75; lean_object* x_76; 
x_75 = lean_ctor_get(x_65, 0);
lean_inc(x_75);
lean_dec(x_65);
x_76 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_76, 0, x_75);
return x_76;
}
}
else
{
lean_object* x_77; lean_object* x_78; lean_object* x_79; 
x_77 = lean_ctor_get(x_65, 0);
lean_inc(x_77);
lean_dec_ref(x_65);
x_78 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__10;
x_79 = l_Lake_JsonObject_getJson_x3f(x_60, x_78);
lean_dec(x_60);
if (lean_obj_tag(x_79) == 0)
{
lean_object* x_80; 
lean_dec(x_77);
x_80 = l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0___closed__1;
return x_80;
}
else
{
lean_object* x_81; lean_object* x_82; 
x_81 = lean_ctor_get(x_79, 0);
lean_inc(x_81);
lean_dec_ref(x_79);
x_82 = l_Lean_Json_getStr_x3f(x_81);
if (lean_obj_tag(x_82) == 0)
{
uint8_t x_83; 
lean_dec(x_77);
x_83 = !lean_is_exclusive(x_82);
if (x_83 == 0)
{
lean_object* x_84; lean_object* x_85; lean_object* x_86; 
x_84 = lean_ctor_get(x_82, 0);
x_85 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__13;
x_86 = lean_string_append(x_85, x_84);
lean_dec(x_84);
lean_ctor_set(x_82, 0, x_86);
return x_82;
}
else
{
lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; 
x_87 = lean_ctor_get(x_82, 0);
lean_inc(x_87);
lean_dec(x_82);
x_88 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__13;
x_89 = lean_string_append(x_88, x_87);
lean_dec(x_87);
x_90 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_90, 0, x_89);
return x_90;
}
}
else
{
if (lean_obj_tag(x_82) == 0)
{
uint8_t x_91; 
lean_dec(x_77);
x_91 = !lean_is_exclusive(x_82);
if (x_91 == 0)
{
lean_ctor_set_tag(x_82, 0);
return x_82;
}
else
{
lean_object* x_92; lean_object* x_93; 
x_92 = lean_ctor_get(x_82, 0);
lean_inc(x_92);
lean_dec(x_82);
x_93 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_93, 0, x_92);
return x_93;
}
}
else
{
uint8_t x_94; 
x_94 = !lean_is_exclusive(x_82);
if (x_94 == 0)
{
lean_object* x_95; lean_object* x_96; 
x_95 = lean_ctor_get(x_82, 0);
x_96 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_96, 0, x_77);
lean_ctor_set(x_96, 1, x_95);
lean_ctor_set(x_82, 0, x_96);
return x_82;
}
else
{
lean_object* x_97; lean_object* x_98; lean_object* x_99; 
x_97 = lean_ctor_get(x_82, 0);
lean_inc(x_97);
lean_dec(x_82);
x_98 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_98, 0, x_77);
lean_ctor_set(x_98, 1, x_97);
x_99 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_99, 0, x_98);
return x_99;
}
}
}
}
}
}
}
}
else
{
lean_dec(x_59);
goto block_43;
}
}
}
}
block_43:
{
lean_object* x_38; lean_object* x_39; 
x_38 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__1;
x_39 = l_Lake_JsonObject_getJson_x3f(x_37, x_38);
lean_dec(x_37);
if (lean_obj_tag(x_39) == 0)
{
x_2 = x_39;
goto block_32;
}
else
{
lean_object* x_40; lean_object* x_41; lean_object* x_42; 
x_40 = lean_ctor_get(x_39, 0);
lean_inc(x_40);
lean_dec_ref(x_39);
x_41 = l_Option_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0_spec__0(x_40);
x_42 = lean_ctor_get(x_41, 0);
lean_inc(x_42);
lean_dec_ref(x_41);
x_2 = x_42;
goto block_32;
}
}
}
block_32:
{
if (lean_obj_tag(x_2) == 1)
{
uint8_t x_3; 
lean_dec(x_1);
x_3 = !lean_is_exclusive(x_2);
if (x_3 == 0)
{
lean_object* x_4; lean_object* x_5; 
x_4 = lean_ctor_get(x_2, 0);
x_5 = l_Lake_RegistryPkg_fromJson_x3f(x_4);
if (lean_obj_tag(x_5) == 0)
{
uint8_t x_6; 
lean_free_object(x_2);
x_6 = !lean_is_exclusive(x_5);
if (x_6 == 0)
{
return x_5;
}
else
{
lean_object* x_7; lean_object* x_8; 
x_7 = lean_ctor_get(x_5, 0);
lean_inc(x_7);
lean_dec(x_5);
x_8 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_8, 0, x_7);
return x_8;
}
}
else
{
uint8_t x_9; 
x_9 = !lean_is_exclusive(x_5);
if (x_9 == 0)
{
lean_object* x_10; 
x_10 = lean_ctor_get(x_5, 0);
lean_ctor_set_tag(x_2, 0);
lean_ctor_set(x_2, 0, x_10);
lean_ctor_set(x_5, 0, x_2);
return x_5;
}
else
{
lean_object* x_11; lean_object* x_12; 
x_11 = lean_ctor_get(x_5, 0);
lean_inc(x_11);
lean_dec(x_5);
lean_ctor_set_tag(x_2, 0);
lean_ctor_set(x_2, 0, x_11);
x_12 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_12, 0, x_2);
return x_12;
}
}
}
else
{
lean_object* x_13; lean_object* x_14; 
x_13 = lean_ctor_get(x_2, 0);
lean_inc(x_13);
lean_dec(x_2);
x_14 = l_Lake_RegistryPkg_fromJson_x3f(x_13);
if (lean_obj_tag(x_14) == 0)
{
lean_object* x_15; lean_object* x_16; lean_object* x_17; 
x_15 = lean_ctor_get(x_14, 0);
lean_inc(x_15);
if (lean_is_exclusive(x_14)) {
 lean_ctor_release(x_14, 0);
 x_16 = x_14;
} else {
 lean_dec_ref(x_14);
 x_16 = lean_box(0);
}
if (lean_is_scalar(x_16)) {
 x_17 = lean_alloc_ctor(0, 1, 0);
} else {
 x_17 = x_16;
}
lean_ctor_set(x_17, 0, x_15);
return x_17;
}
else
{
lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; 
x_18 = lean_ctor_get(x_14, 0);
lean_inc(x_18);
if (lean_is_exclusive(x_14)) {
 lean_ctor_release(x_14, 0);
 x_19 = x_14;
} else {
 lean_dec_ref(x_14);
 x_19 = lean_box(0);
}
x_20 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_20, 0, x_18);
if (lean_is_scalar(x_19)) {
 x_21 = lean_alloc_ctor(1, 1, 0);
} else {
 x_21 = x_19;
}
lean_ctor_set(x_21, 0, x_20);
return x_21;
}
}
}
else
{
lean_object* x_22; 
lean_dec(x_2);
x_22 = l_Lake_RegistryPkg_fromJson_x3f(x_1);
if (lean_obj_tag(x_22) == 0)
{
uint8_t x_23; 
x_23 = !lean_is_exclusive(x_22);
if (x_23 == 0)
{
return x_22;
}
else
{
lean_object* x_24; lean_object* x_25; 
x_24 = lean_ctor_get(x_22, 0);
lean_inc(x_24);
lean_dec(x_22);
x_25 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_25, 0, x_24);
return x_25;
}
}
else
{
uint8_t x_26; 
x_26 = !lean_is_exclusive(x_22);
if (x_26 == 0)
{
lean_object* x_27; lean_object* x_28; 
x_27 = lean_ctor_get(x_22, 0);
x_28 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_28, 0, x_27);
lean_ctor_set(x_22, 0, x_28);
return x_22;
}
else
{
lean_object* x_29; lean_object* x_30; lean_object* x_31; 
x_29 = lean_ctor_get(x_22, 0);
lean_inc(x_29);
lean_dec(x_22);
x_30 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_30, 0, x_29);
x_31 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_31, 0, x_30);
return x_31;
}
}
}
}
}
}
LEAN_EXPORT lean_object* l_Lake_Reservoir_fetchPkg_x3f(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
lean_object* x_6; lean_object* x_7; lean_object* x_8; 
lean_inc_ref(x_3);
lean_inc_ref(x_2);
x_6 = l_Lake_Reservoir_pkgApiUrl(x_1, x_2, x_3);
x_7 = l_Lake_Reservoir_fetchPkg_x3f___closed__0;
x_8 = l_Lake_getUrl(x_6, x_7, x_4);
if (lean_obj_tag(x_8) == 0)
{
uint8_t x_9; 
x_9 = !lean_is_exclusive(x_8);
if (x_9 == 0)
{
lean_object* x_10; lean_object* x_11; lean_object* x_12; 
x_10 = lean_ctor_get(x_8, 0);
x_11 = lean_ctor_get(x_8, 1);
lean_inc(x_10);
x_12 = l_Lean_Json_parse(x_10);
if (lean_obj_tag(x_12) == 0)
{
lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; uint8_t x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; uint8_t x_32; lean_object* x_33; lean_object* x_34; 
x_13 = lean_ctor_get(x_12, 0);
lean_inc(x_13);
lean_dec_ref(x_12);
x_14 = l_Lake_Reservoir_pkgApiUrl___closed__1;
x_15 = lean_string_append(x_2, x_14);
x_16 = lean_string_append(x_15, x_3);
lean_dec_ref(x_3);
x_17 = l_Lake_Reservoir_fetchPkg_x3f___closed__1;
lean_inc_ref(x_16);
x_18 = lean_string_append(x_16, x_17);
x_19 = lean_string_append(x_18, x_13);
lean_dec(x_13);
x_20 = 3;
x_21 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_21, 0, x_19);
lean_ctor_set_uint8(x_21, sizeof(void*)*1, x_20);
x_22 = lean_array_get_size(x_11);
x_23 = lean_array_push(x_11, x_21);
x_24 = l_Lake_Reservoir_fetchPkg_x3f___closed__2;
x_25 = lean_string_append(x_16, x_24);
x_26 = lean_unsigned_to_nat(0u);
x_27 = lean_string_utf8_byte_size(x_10);
x_28 = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(x_28, 0, x_10);
lean_ctor_set(x_28, 1, x_26);
lean_ctor_set(x_28, 2, x_27);
x_29 = l_String_Slice_trimAscii(x_28);
lean_dec_ref(x_28);
x_30 = l_String_Slice_toString(x_29);
lean_dec_ref(x_29);
x_31 = lean_string_append(x_25, x_30);
lean_dec_ref(x_30);
x_32 = 0;
x_33 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_33, 0, x_31);
lean_ctor_set_uint8(x_33, sizeof(void*)*1, x_32);
x_34 = lean_array_push(x_23, x_33);
lean_ctor_set_tag(x_8, 1);
lean_ctor_set(x_8, 1, x_34);
lean_ctor_set(x_8, 0, x_22);
return x_8;
}
else
{
lean_object* x_35; lean_object* x_36; 
x_35 = lean_ctor_get(x_12, 0);
lean_inc(x_35);
lean_dec_ref(x_12);
x_36 = l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0(x_35);
if (lean_obj_tag(x_36) == 0)
{
lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; uint8_t x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; uint8_t x_56; lean_object* x_57; lean_object* x_58; 
x_37 = lean_ctor_get(x_36, 0);
lean_inc(x_37);
lean_dec_ref(x_36);
x_38 = l_Lake_Reservoir_pkgApiUrl___closed__1;
x_39 = lean_string_append(x_2, x_38);
x_40 = lean_string_append(x_39, x_3);
lean_dec_ref(x_3);
x_41 = l_Lake_Reservoir_fetchPkg_x3f___closed__3;
lean_inc_ref(x_40);
x_42 = lean_string_append(x_40, x_41);
x_43 = lean_string_append(x_42, x_37);
lean_dec(x_37);
x_44 = 3;
x_45 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_45, 0, x_43);
lean_ctor_set_uint8(x_45, sizeof(void*)*1, x_44);
x_46 = lean_array_get_size(x_11);
x_47 = lean_array_push(x_11, x_45);
x_48 = l_Lake_Reservoir_fetchPkg_x3f___closed__2;
x_49 = lean_string_append(x_40, x_48);
x_50 = lean_unsigned_to_nat(0u);
x_51 = lean_string_utf8_byte_size(x_10);
x_52 = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(x_52, 0, x_10);
lean_ctor_set(x_52, 1, x_50);
lean_ctor_set(x_52, 2, x_51);
x_53 = l_String_Slice_trimAscii(x_52);
lean_dec_ref(x_52);
x_54 = l_String_Slice_toString(x_53);
lean_dec_ref(x_53);
x_55 = lean_string_append(x_49, x_54);
lean_dec_ref(x_54);
x_56 = 0;
x_57 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_57, 0, x_55);
lean_ctor_set_uint8(x_57, sizeof(void*)*1, x_56);
x_58 = lean_array_push(x_47, x_57);
lean_ctor_set_tag(x_8, 1);
lean_ctor_set(x_8, 1, x_58);
lean_ctor_set(x_8, 0, x_46);
return x_8;
}
else
{
lean_object* x_59; 
lean_dec(x_10);
x_59 = lean_ctor_get(x_36, 0);
lean_inc(x_59);
lean_dec_ref(x_36);
if (lean_obj_tag(x_59) == 0)
{
uint8_t x_60; 
lean_dec_ref(x_3);
lean_dec_ref(x_2);
x_60 = !lean_is_exclusive(x_59);
if (x_60 == 0)
{
lean_ctor_set_tag(x_59, 1);
lean_ctor_set(x_8, 0, x_59);
return x_8;
}
else
{
lean_object* x_61; lean_object* x_62; 
x_61 = lean_ctor_get(x_59, 0);
lean_inc(x_61);
lean_dec(x_59);
x_62 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_62, 0, x_61);
lean_ctor_set(x_8, 0, x_62);
return x_8;
}
}
else
{
lean_object* x_63; lean_object* x_64; lean_object* x_65; uint8_t x_66; 
x_63 = lean_ctor_get(x_59, 0);
lean_inc(x_63);
x_64 = lean_ctor_get(x_59, 1);
lean_inc_ref(x_64);
lean_dec_ref(x_59);
x_65 = lean_unsigned_to_nat(404u);
x_66 = lean_nat_dec_eq(x_63, x_65);
lean_dec(x_63);
if (x_66 == 0)
{
lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; uint8_t x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; 
x_67 = l_Lake_Reservoir_pkgApiUrl___closed__1;
x_68 = lean_string_append(x_2, x_67);
x_69 = lean_string_append(x_68, x_3);
lean_dec_ref(x_3);
x_70 = l_Lake_Reservoir_fetchPkg_x3f___closed__4;
x_71 = lean_string_append(x_69, x_70);
x_72 = lean_string_append(x_71, x_64);
lean_dec_ref(x_64);
x_73 = 3;
x_74 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_74, 0, x_72);
lean_ctor_set_uint8(x_74, sizeof(void*)*1, x_73);
x_75 = lean_array_get_size(x_11);
x_76 = lean_array_push(x_11, x_74);
lean_ctor_set_tag(x_8, 1);
lean_ctor_set(x_8, 1, x_76);
lean_ctor_set(x_8, 0, x_75);
return x_8;
}
else
{
lean_object* x_77; 
lean_dec_ref(x_64);
lean_dec_ref(x_3);
lean_dec_ref(x_2);
x_77 = lean_box(0);
lean_ctor_set(x_8, 0, x_77);
return x_8;
}
}
}
}
}
else
{
lean_object* x_78; lean_object* x_79; lean_object* x_80; 
x_78 = lean_ctor_get(x_8, 0);
x_79 = lean_ctor_get(x_8, 1);
lean_inc(x_79);
lean_inc(x_78);
lean_dec(x_8);
lean_inc(x_78);
x_80 = l_Lean_Json_parse(x_78);
if (lean_obj_tag(x_80) == 0)
{
lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; uint8_t x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; lean_object* x_99; uint8_t x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; 
x_81 = lean_ctor_get(x_80, 0);
lean_inc(x_81);
lean_dec_ref(x_80);
x_82 = l_Lake_Reservoir_pkgApiUrl___closed__1;
x_83 = lean_string_append(x_2, x_82);
x_84 = lean_string_append(x_83, x_3);
lean_dec_ref(x_3);
x_85 = l_Lake_Reservoir_fetchPkg_x3f___closed__1;
lean_inc_ref(x_84);
x_86 = lean_string_append(x_84, x_85);
x_87 = lean_string_append(x_86, x_81);
lean_dec(x_81);
x_88 = 3;
x_89 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_89, 0, x_87);
lean_ctor_set_uint8(x_89, sizeof(void*)*1, x_88);
x_90 = lean_array_get_size(x_79);
x_91 = lean_array_push(x_79, x_89);
x_92 = l_Lake_Reservoir_fetchPkg_x3f___closed__2;
x_93 = lean_string_append(x_84, x_92);
x_94 = lean_unsigned_to_nat(0u);
x_95 = lean_string_utf8_byte_size(x_78);
x_96 = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(x_96, 0, x_78);
lean_ctor_set(x_96, 1, x_94);
lean_ctor_set(x_96, 2, x_95);
x_97 = l_String_Slice_trimAscii(x_96);
lean_dec_ref(x_96);
x_98 = l_String_Slice_toString(x_97);
lean_dec_ref(x_97);
x_99 = lean_string_append(x_93, x_98);
lean_dec_ref(x_98);
x_100 = 0;
x_101 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_101, 0, x_99);
lean_ctor_set_uint8(x_101, sizeof(void*)*1, x_100);
x_102 = lean_array_push(x_91, x_101);
x_103 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_103, 0, x_90);
lean_ctor_set(x_103, 1, x_102);
return x_103;
}
else
{
lean_object* x_104; lean_object* x_105; 
x_104 = lean_ctor_get(x_80, 0);
lean_inc(x_104);
lean_dec_ref(x_80);
x_105 = l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0(x_104);
if (lean_obj_tag(x_105) == 0)
{
lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; uint8_t x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; lean_object* x_119; lean_object* x_120; lean_object* x_121; lean_object* x_122; lean_object* x_123; lean_object* x_124; uint8_t x_125; lean_object* x_126; lean_object* x_127; lean_object* x_128; 
x_106 = lean_ctor_get(x_105, 0);
lean_inc(x_106);
lean_dec_ref(x_105);
x_107 = l_Lake_Reservoir_pkgApiUrl___closed__1;
x_108 = lean_string_append(x_2, x_107);
x_109 = lean_string_append(x_108, x_3);
lean_dec_ref(x_3);
x_110 = l_Lake_Reservoir_fetchPkg_x3f___closed__3;
lean_inc_ref(x_109);
x_111 = lean_string_append(x_109, x_110);
x_112 = lean_string_append(x_111, x_106);
lean_dec(x_106);
x_113 = 3;
x_114 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_114, 0, x_112);
lean_ctor_set_uint8(x_114, sizeof(void*)*1, x_113);
x_115 = lean_array_get_size(x_79);
x_116 = lean_array_push(x_79, x_114);
x_117 = l_Lake_Reservoir_fetchPkg_x3f___closed__2;
x_118 = lean_string_append(x_109, x_117);
x_119 = lean_unsigned_to_nat(0u);
x_120 = lean_string_utf8_byte_size(x_78);
x_121 = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(x_121, 0, x_78);
lean_ctor_set(x_121, 1, x_119);
lean_ctor_set(x_121, 2, x_120);
x_122 = l_String_Slice_trimAscii(x_121);
lean_dec_ref(x_121);
x_123 = l_String_Slice_toString(x_122);
lean_dec_ref(x_122);
x_124 = lean_string_append(x_118, x_123);
lean_dec_ref(x_123);
x_125 = 0;
x_126 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_126, 0, x_124);
lean_ctor_set_uint8(x_126, sizeof(void*)*1, x_125);
x_127 = lean_array_push(x_116, x_126);
x_128 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_128, 0, x_115);
lean_ctor_set(x_128, 1, x_127);
return x_128;
}
else
{
lean_object* x_129; 
lean_dec(x_78);
x_129 = lean_ctor_get(x_105, 0);
lean_inc(x_129);
lean_dec_ref(x_105);
if (lean_obj_tag(x_129) == 0)
{
lean_object* x_130; lean_object* x_131; lean_object* x_132; lean_object* x_133; 
lean_dec_ref(x_3);
lean_dec_ref(x_2);
x_130 = lean_ctor_get(x_129, 0);
lean_inc(x_130);
if (lean_is_exclusive(x_129)) {
 lean_ctor_release(x_129, 0);
 x_131 = x_129;
} else {
 lean_dec_ref(x_129);
 x_131 = lean_box(0);
}
if (lean_is_scalar(x_131)) {
 x_132 = lean_alloc_ctor(1, 1, 0);
} else {
 x_132 = x_131;
 lean_ctor_set_tag(x_132, 1);
}
lean_ctor_set(x_132, 0, x_130);
x_133 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_133, 0, x_132);
lean_ctor_set(x_133, 1, x_79);
return x_133;
}
else
{
lean_object* x_134; lean_object* x_135; lean_object* x_136; uint8_t x_137; 
x_134 = lean_ctor_get(x_129, 0);
lean_inc(x_134);
x_135 = lean_ctor_get(x_129, 1);
lean_inc_ref(x_135);
lean_dec_ref(x_129);
x_136 = lean_unsigned_to_nat(404u);
x_137 = lean_nat_dec_eq(x_134, x_136);
lean_dec(x_134);
if (x_137 == 0)
{
lean_object* x_138; lean_object* x_139; lean_object* x_140; lean_object* x_141; lean_object* x_142; lean_object* x_143; uint8_t x_144; lean_object* x_145; lean_object* x_146; lean_object* x_147; lean_object* x_148; 
x_138 = l_Lake_Reservoir_pkgApiUrl___closed__1;
x_139 = lean_string_append(x_2, x_138);
x_140 = lean_string_append(x_139, x_3);
lean_dec_ref(x_3);
x_141 = l_Lake_Reservoir_fetchPkg_x3f___closed__4;
x_142 = lean_string_append(x_140, x_141);
x_143 = lean_string_append(x_142, x_135);
lean_dec_ref(x_135);
x_144 = 3;
x_145 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_145, 0, x_143);
lean_ctor_set_uint8(x_145, sizeof(void*)*1, x_144);
x_146 = lean_array_get_size(x_79);
x_147 = lean_array_push(x_79, x_145);
x_148 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_148, 0, x_146);
lean_ctor_set(x_148, 1, x_147);
return x_148;
}
else
{
lean_object* x_149; lean_object* x_150; 
lean_dec_ref(x_135);
lean_dec_ref(x_3);
lean_dec_ref(x_2);
x_149 = lean_box(0);
x_150 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_150, 0, x_149);
lean_ctor_set(x_150, 1, x_79);
return x_150;
}
}
}
}
}
}
else
{
uint8_t x_151; 
x_151 = !lean_is_exclusive(x_8);
if (x_151 == 0)
{
lean_object* x_152; lean_object* x_153; lean_object* x_154; lean_object* x_155; lean_object* x_156; lean_object* x_157; uint8_t x_158; lean_object* x_159; lean_object* x_160; 
x_152 = lean_ctor_get(x_8, 1);
x_153 = l_Lake_Reservoir_pkgApiUrl___closed__1;
x_154 = lean_string_append(x_2, x_153);
x_155 = lean_string_append(x_154, x_3);
lean_dec_ref(x_3);
x_156 = l_Lake_Reservoir_fetchPkg_x3f___closed__5;
x_157 = lean_string_append(x_155, x_156);
x_158 = 3;
x_159 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_159, 0, x_157);
lean_ctor_set_uint8(x_159, sizeof(void*)*1, x_158);
x_160 = lean_array_push(x_152, x_159);
lean_ctor_set(x_8, 1, x_160);
return x_8;
}
else
{
lean_object* x_161; lean_object* x_162; lean_object* x_163; lean_object* x_164; lean_object* x_165; lean_object* x_166; lean_object* x_167; uint8_t x_168; lean_object* x_169; lean_object* x_170; lean_object* x_171; 
x_161 = lean_ctor_get(x_8, 0);
x_162 = lean_ctor_get(x_8, 1);
lean_inc(x_162);
lean_inc(x_161);
lean_dec(x_8);
x_163 = l_Lake_Reservoir_pkgApiUrl___closed__1;
x_164 = lean_string_append(x_2, x_163);
x_165 = lean_string_append(x_164, x_3);
lean_dec_ref(x_3);
x_166 = l_Lake_Reservoir_fetchPkg_x3f___closed__5;
x_167 = lean_string_append(x_165, x_166);
x_168 = 3;
x_169 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_169, 0, x_167);
lean_ctor_set_uint8(x_169, sizeof(void*)*1, x_168);
x_170 = lean_array_push(x_162, x_169);
x_171 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_171, 0, x_161);
lean_ctor_set(x_171, 1, x_170);
return x_171;
}
}
}
}
LEAN_EXPORT lean_object* l_Lake_Reservoir_fetchPkg_x3f___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
lean_object* x_6; 
x_6 = l_Lake_Reservoir_fetchPkg_x3f(x_1, x_2, x_3, x_4);
return x_6;
}
}
static lean_object* _init_l_Lake_RegistryVer_fromJson_x3f___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("invalid registry version: ", 26, 26);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistryVer_fromJson_x3f___closed__1() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("version: ", 9, 9);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistryVer_fromJson_x3f___closed__2() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("version", 7, 7);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistryVer_fromJson_x3f___closed__3() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("property not found: version", 27, 27);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistryVer_fromJson_x3f___closed__4() {
_start:
{
lean_object* x_1; 
x_1 = lean_alloc_closure((void*)(l_Lake_StdVer_parseM), 2, 0);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistryVer_fromJson_x3f___closed__5() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("revision", 8, 8);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistryVer_fromJson_x3f___closed__6() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("property not found: revision", 28, 28);
return x_1;
}
}
static lean_object* _init_l_Lake_RegistryVer_fromJson_x3f___closed__7() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("revision: ", 10, 10);
return x_1;
}
}
LEAN_EXPORT lean_object* l_Lake_RegistryVer_fromJson_x3f(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_7; lean_object* x_11; 
x_11 = l_Lean_Json_getObj_x3f(x_1);
if (lean_obj_tag(x_11) == 0)
{
lean_object* x_12; 
x_12 = lean_ctor_get(x_11, 0);
lean_inc(x_12);
lean_dec_ref(x_11);
x_2 = x_12;
goto block_6;
}
else
{
lean_object* x_13; lean_object* x_14; lean_object* x_15; 
x_13 = lean_ctor_get(x_11, 0);
lean_inc(x_13);
lean_dec_ref(x_11);
x_14 = l_Lake_RegistryVer_fromJson_x3f___closed__2;
x_15 = l_Lake_JsonObject_getJson_x3f(x_13, x_14);
if (lean_obj_tag(x_15) == 0)
{
lean_object* x_16; 
lean_dec(x_13);
x_16 = l_Lake_RegistryVer_fromJson_x3f___closed__3;
x_2 = x_16;
goto block_6;
}
else
{
lean_object* x_17; lean_object* x_18; 
x_17 = lean_ctor_get(x_15, 0);
lean_inc(x_17);
lean_dec_ref(x_15);
x_18 = l_Lean_Json_getStr_x3f(x_17);
if (lean_obj_tag(x_18) == 0)
{
lean_object* x_19; 
lean_dec(x_13);
x_19 = lean_ctor_get(x_18, 0);
lean_inc(x_19);
lean_dec_ref(x_18);
x_7 = x_19;
goto block_10;
}
else
{
lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; 
x_20 = lean_ctor_get(x_18, 0);
lean_inc(x_20);
lean_dec_ref(x_18);
x_21 = l_Lake_RegistryVer_fromJson_x3f___closed__4;
x_22 = lean_unsigned_to_nat(0u);
x_23 = lean_string_utf8_byte_size(x_20);
x_24 = l___private_Lake_Util_Version_0__Lake_runVerParse(lean_box(0), x_20, x_21, x_22, x_23);
lean_dec(x_23);
if (lean_obj_tag(x_24) == 0)
{
lean_object* x_25; 
lean_dec(x_13);
x_25 = lean_ctor_get(x_24, 0);
lean_inc(x_25);
lean_dec_ref(x_24);
x_7 = x_25;
goto block_10;
}
else
{
lean_object* x_26; lean_object* x_27; lean_object* x_28; 
x_26 = lean_ctor_get(x_24, 0);
lean_inc(x_26);
lean_dec_ref(x_24);
x_27 = l_Lake_RegistryVer_fromJson_x3f___closed__5;
x_28 = l_Lake_JsonObject_getJson_x3f(x_13, x_27);
lean_dec(x_13);
if (lean_obj_tag(x_28) == 0)
{
lean_object* x_29; 
lean_dec(x_26);
x_29 = l_Lake_RegistryVer_fromJson_x3f___closed__6;
x_2 = x_29;
goto block_6;
}
else
{
lean_object* x_30; lean_object* x_31; 
x_30 = lean_ctor_get(x_28, 0);
lean_inc(x_30);
lean_dec_ref(x_28);
x_31 = l_Lean_Json_getStr_x3f(x_30);
if (lean_obj_tag(x_31) == 0)
{
lean_object* x_32; lean_object* x_33; lean_object* x_34; 
lean_dec(x_26);
x_32 = lean_ctor_get(x_31, 0);
lean_inc(x_32);
lean_dec_ref(x_31);
x_33 = l_Lake_RegistryVer_fromJson_x3f___closed__7;
x_34 = lean_string_append(x_33, x_32);
lean_dec(x_32);
x_2 = x_34;
goto block_6;
}
else
{
if (lean_obj_tag(x_31) == 0)
{
lean_object* x_35; 
lean_dec(x_26);
x_35 = lean_ctor_get(x_31, 0);
lean_inc(x_35);
lean_dec_ref(x_31);
x_2 = x_35;
goto block_6;
}
else
{
uint8_t x_36; 
x_36 = !lean_is_exclusive(x_31);
if (x_36 == 0)
{
lean_object* x_37; lean_object* x_38; 
x_37 = lean_ctor_get(x_31, 0);
x_38 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_38, 0, x_26);
lean_ctor_set(x_38, 1, x_37);
lean_ctor_set(x_31, 0, x_38);
return x_31;
}
else
{
lean_object* x_39; lean_object* x_40; lean_object* x_41; 
x_39 = lean_ctor_get(x_31, 0);
lean_inc(x_39);
lean_dec(x_31);
x_40 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_40, 0, x_26);
lean_ctor_set(x_40, 1, x_39);
x_41 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_41, 0, x_40);
return x_41;
}
}
}
}
}
}
}
}
block_6:
{
lean_object* x_3; lean_object* x_4; lean_object* x_5; 
x_3 = l_Lake_RegistryVer_fromJson_x3f___closed__0;
x_4 = lean_string_append(x_3, x_2);
lean_dec_ref(x_2);
x_5 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_5, 0, x_4);
return x_5;
}
block_10:
{
lean_object* x_8; lean_object* x_9; 
x_8 = l_Lake_RegistryVer_fromJson_x3f___closed__1;
x_9 = lean_string_append(x_8, x_7);
lean_dec_ref(x_7);
x_2 = x_9;
goto block_6;
}
}
}
static lean_object* _init_l_Lake_instFromJsonRegistryVer___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = lean_alloc_closure((void*)(l_Lake_RegistryVer_fromJson_x3f), 1, 0);
return x_1;
}
}
static lean_object* _init_l_Lake_instFromJsonRegistryVer() {
_start:
{
lean_object* x_1; 
x_1 = l_Lake_instFromJsonRegistryVer___closed__0;
return x_1;
}
}
static lean_object* _init_l_Lake_Reservoir_pkgVersionsApiUrl___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("/versions", 9, 9);
return x_1;
}
}
LEAN_EXPORT lean_object* l_Lake_Reservoir_pkgVersionsApiUrl(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; 
x_4 = lean_ctor_get(x_1, 3);
lean_inc_ref(x_4);
lean_dec_ref(x_1);
x_5 = l_Lake_Reservoir_pkgApiUrl___closed__0;
x_6 = lean_string_append(x_4, x_5);
x_7 = l_Lake_instInhabitedRegistrySrc_default___closed__0;
x_8 = l_Lake_uriEncode(x_2, x_7);
x_9 = lean_string_append(x_6, x_8);
lean_dec_ref(x_8);
x_10 = l_Lake_Reservoir_pkgApiUrl___closed__1;
x_11 = lean_string_append(x_9, x_10);
x_12 = l_Lake_uriEncode(x_3, x_7);
x_13 = lean_string_append(x_11, x_12);
lean_dec_ref(x_12);
x_14 = l_Lake_Reservoir_pkgVersionsApiUrl___closed__0;
x_15 = lean_string_append(x_13, x_14);
return x_15;
}
}
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_mapMUnsafe_map___at___00Array_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0_spec__0_spec__0(size_t x_1, size_t x_2, lean_object* x_3) {
_start:
{
uint8_t x_4; 
x_4 = lean_usize_dec_lt(x_2, x_1);
if (x_4 == 0)
{
lean_object* x_5; 
x_5 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_5, 0, x_3);
return x_5;
}
else
{
lean_object* x_6; lean_object* x_7; 
x_6 = lean_array_uget(x_3, x_2);
x_7 = l_Lake_RegistryVer_fromJson_x3f(x_6);
if (lean_obj_tag(x_7) == 0)
{
uint8_t x_8; 
lean_dec_ref(x_3);
x_8 = !lean_is_exclusive(x_7);
if (x_8 == 0)
{
return x_7;
}
else
{
lean_object* x_9; lean_object* x_10; 
x_9 = lean_ctor_get(x_7, 0);
lean_inc(x_9);
lean_dec(x_7);
x_10 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_10, 0, x_9);
return x_10;
}
}
else
{
lean_object* x_11; lean_object* x_12; lean_object* x_13; size_t x_14; size_t x_15; lean_object* x_16; 
x_11 = lean_ctor_get(x_7, 0);
lean_inc(x_11);
lean_dec_ref(x_7);
x_12 = lean_unsigned_to_nat(0u);
x_13 = lean_array_uset(x_3, x_2, x_12);
x_14 = 1;
x_15 = lean_usize_add(x_2, x_14);
x_16 = lean_array_uset(x_13, x_2, x_11);
x_2 = x_15;
x_3 = x_16;
goto _start;
}
}
}
}
LEAN_EXPORT lean_object* l_Array_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0_spec__0(lean_object* x_1) {
_start:
{
if (lean_obj_tag(x_1) == 4)
{
lean_object* x_2; size_t x_3; size_t x_4; lean_object* x_5; 
x_2 = lean_ctor_get(x_1, 0);
lean_inc_ref(x_2);
lean_dec_ref(x_1);
x_3 = lean_array_size(x_2);
x_4 = 0;
x_5 = l___private_Init_Data_Array_Basic_0__Array_mapMUnsafe_map___at___00Array_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0_spec__0_spec__0(x_3, x_4, x_2);
return x_5;
}
else
{
lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; 
x_6 = l_Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1___closed__0;
x_7 = lean_unsigned_to_nat(80u);
x_8 = l_Lean_Json_pretty(x_1, x_7);
x_9 = lean_string_append(x_6, x_8);
lean_dec_ref(x_8);
x_10 = l_Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1___closed__1;
x_11 = lean_string_append(x_9, x_10);
x_12 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_12, 0, x_11);
return x_12;
}
}
}
static lean_object* _init_l_Lake_Reservoir_fetchPkgVersions___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked(": Reservoir lookup failed (code: ", 33, 33);
return x_1;
}
}
static lean_object* _init_l_Lake_Reservoir_fetchPkgVersions___closed__1() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("): ", 3, 3);
return x_1;
}
}
static lean_object* _init_l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0___closed__0() {
_start:
{
lean_object* x_1; lean_object* x_2; 
x_1 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__7;
x_2 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
static lean_object* _init_l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2; 
x_1 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__11;
x_2 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_33; 
lean_inc(x_1);
x_33 = l_Lean_Json_getObj_x3f(x_1);
if (lean_obj_tag(x_33) == 0)
{
uint8_t x_34; 
lean_dec(x_1);
x_34 = !lean_is_exclusive(x_33);
if (x_34 == 0)
{
return x_33;
}
else
{
lean_object* x_35; lean_object* x_36; 
x_35 = lean_ctor_get(x_33, 0);
lean_inc(x_35);
lean_dec(x_33);
x_36 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_36, 0, x_35);
return x_36;
}
}
else
{
lean_object* x_37; lean_object* x_44; lean_object* x_45; 
x_37 = lean_ctor_get(x_33, 0);
lean_inc(x_37);
lean_dec_ref(x_33);
x_44 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__3;
x_45 = l_Lake_JsonObject_getJson_x3f(x_37, x_44);
if (lean_obj_tag(x_45) == 0)
{
goto block_43;
}
else
{
lean_object* x_46; lean_object* x_47; 
x_46 = lean_ctor_get(x_45, 0);
lean_inc(x_46);
lean_dec_ref(x_45);
x_47 = l_Option_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0_spec__1(x_46);
if (lean_obj_tag(x_47) == 0)
{
uint8_t x_48; 
lean_dec(x_37);
lean_dec(x_1);
x_48 = !lean_is_exclusive(x_47);
if (x_48 == 0)
{
lean_object* x_49; lean_object* x_50; lean_object* x_51; 
x_49 = lean_ctor_get(x_47, 0);
x_50 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__5;
x_51 = lean_string_append(x_50, x_49);
lean_dec(x_49);
lean_ctor_set(x_47, 0, x_51);
return x_47;
}
else
{
lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; 
x_52 = lean_ctor_get(x_47, 0);
lean_inc(x_52);
lean_dec(x_47);
x_53 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__5;
x_54 = lean_string_append(x_53, x_52);
lean_dec(x_52);
x_55 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_55, 0, x_54);
return x_55;
}
}
else
{
if (lean_obj_tag(x_47) == 0)
{
uint8_t x_56; 
lean_dec(x_37);
lean_dec(x_1);
x_56 = !lean_is_exclusive(x_47);
if (x_56 == 0)
{
lean_ctor_set_tag(x_47, 0);
return x_47;
}
else
{
lean_object* x_57; lean_object* x_58; 
x_57 = lean_ctor_get(x_47, 0);
lean_inc(x_57);
lean_dec(x_47);
x_58 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_58, 0, x_57);
return x_58;
}
}
else
{
lean_object* x_59; 
x_59 = lean_ctor_get(x_47, 0);
lean_inc(x_59);
lean_dec_ref(x_47);
if (lean_obj_tag(x_59) == 1)
{
lean_object* x_60; lean_object* x_61; lean_object* x_62; 
lean_dec(x_37);
lean_dec(x_1);
x_60 = lean_ctor_get(x_59, 0);
lean_inc(x_60);
lean_dec_ref(x_59);
x_61 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__6;
x_62 = l_Lake_JsonObject_getJson_x3f(x_60, x_61);
if (lean_obj_tag(x_62) == 0)
{
lean_object* x_63; 
lean_dec(x_60);
x_63 = l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0___closed__0;
return x_63;
}
else
{
lean_object* x_64; lean_object* x_65; 
x_64 = lean_ctor_get(x_62, 0);
lean_inc(x_64);
lean_dec_ref(x_62);
x_65 = l_Lean_Json_getNat_x3f(x_64);
if (lean_obj_tag(x_65) == 0)
{
uint8_t x_66; 
lean_dec(x_60);
x_66 = !lean_is_exclusive(x_65);
if (x_66 == 0)
{
lean_object* x_67; lean_object* x_68; lean_object* x_69; 
x_67 = lean_ctor_get(x_65, 0);
x_68 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__9;
x_69 = lean_string_append(x_68, x_67);
lean_dec(x_67);
lean_ctor_set(x_65, 0, x_69);
return x_65;
}
else
{
lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; 
x_70 = lean_ctor_get(x_65, 0);
lean_inc(x_70);
lean_dec(x_65);
x_71 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__9;
x_72 = lean_string_append(x_71, x_70);
lean_dec(x_70);
x_73 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_73, 0, x_72);
return x_73;
}
}
else
{
if (lean_obj_tag(x_65) == 0)
{
uint8_t x_74; 
lean_dec(x_60);
x_74 = !lean_is_exclusive(x_65);
if (x_74 == 0)
{
lean_ctor_set_tag(x_65, 0);
return x_65;
}
else
{
lean_object* x_75; lean_object* x_76; 
x_75 = lean_ctor_get(x_65, 0);
lean_inc(x_75);
lean_dec(x_65);
x_76 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_76, 0, x_75);
return x_76;
}
}
else
{
lean_object* x_77; lean_object* x_78; lean_object* x_79; 
x_77 = lean_ctor_get(x_65, 0);
lean_inc(x_77);
lean_dec_ref(x_65);
x_78 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__10;
x_79 = l_Lake_JsonObject_getJson_x3f(x_60, x_78);
lean_dec(x_60);
if (lean_obj_tag(x_79) == 0)
{
lean_object* x_80; 
lean_dec(x_77);
x_80 = l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0___closed__1;
return x_80;
}
else
{
lean_object* x_81; lean_object* x_82; 
x_81 = lean_ctor_get(x_79, 0);
lean_inc(x_81);
lean_dec_ref(x_79);
x_82 = l_Lean_Json_getStr_x3f(x_81);
if (lean_obj_tag(x_82) == 0)
{
uint8_t x_83; 
lean_dec(x_77);
x_83 = !lean_is_exclusive(x_82);
if (x_83 == 0)
{
lean_object* x_84; lean_object* x_85; lean_object* x_86; 
x_84 = lean_ctor_get(x_82, 0);
x_85 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__13;
x_86 = lean_string_append(x_85, x_84);
lean_dec(x_84);
lean_ctor_set(x_82, 0, x_86);
return x_82;
}
else
{
lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; 
x_87 = lean_ctor_get(x_82, 0);
lean_inc(x_87);
lean_dec(x_82);
x_88 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__13;
x_89 = lean_string_append(x_88, x_87);
lean_dec(x_87);
x_90 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_90, 0, x_89);
return x_90;
}
}
else
{
if (lean_obj_tag(x_82) == 0)
{
uint8_t x_91; 
lean_dec(x_77);
x_91 = !lean_is_exclusive(x_82);
if (x_91 == 0)
{
lean_ctor_set_tag(x_82, 0);
return x_82;
}
else
{
lean_object* x_92; lean_object* x_93; 
x_92 = lean_ctor_get(x_82, 0);
lean_inc(x_92);
lean_dec(x_82);
x_93 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_93, 0, x_92);
return x_93;
}
}
else
{
uint8_t x_94; 
x_94 = !lean_is_exclusive(x_82);
if (x_94 == 0)
{
lean_object* x_95; lean_object* x_96; 
x_95 = lean_ctor_get(x_82, 0);
x_96 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_96, 0, x_77);
lean_ctor_set(x_96, 1, x_95);
lean_ctor_set(x_82, 0, x_96);
return x_82;
}
else
{
lean_object* x_97; lean_object* x_98; lean_object* x_99; 
x_97 = lean_ctor_get(x_82, 0);
lean_inc(x_97);
lean_dec(x_82);
x_98 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_98, 0, x_77);
lean_ctor_set(x_98, 1, x_97);
x_99 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_99, 0, x_98);
return x_99;
}
}
}
}
}
}
}
}
else
{
lean_dec(x_59);
goto block_43;
}
}
}
}
block_43:
{
lean_object* x_38; lean_object* x_39; 
x_38 = l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__1;
x_39 = l_Lake_JsonObject_getJson_x3f(x_37, x_38);
lean_dec(x_37);
if (lean_obj_tag(x_39) == 0)
{
x_2 = x_39;
goto block_32;
}
else
{
lean_object* x_40; lean_object* x_41; lean_object* x_42; 
x_40 = lean_ctor_get(x_39, 0);
lean_inc(x_40);
lean_dec_ref(x_39);
x_41 = l_Option_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0_spec__0(x_40);
x_42 = lean_ctor_get(x_41, 0);
lean_inc(x_42);
lean_dec_ref(x_41);
x_2 = x_42;
goto block_32;
}
}
}
block_32:
{
if (lean_obj_tag(x_2) == 1)
{
uint8_t x_3; 
lean_dec(x_1);
x_3 = !lean_is_exclusive(x_2);
if (x_3 == 0)
{
lean_object* x_4; lean_object* x_5; 
x_4 = lean_ctor_get(x_2, 0);
x_5 = l_Array_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0_spec__0(x_4);
if (lean_obj_tag(x_5) == 0)
{
uint8_t x_6; 
lean_free_object(x_2);
x_6 = !lean_is_exclusive(x_5);
if (x_6 == 0)
{
return x_5;
}
else
{
lean_object* x_7; lean_object* x_8; 
x_7 = lean_ctor_get(x_5, 0);
lean_inc(x_7);
lean_dec(x_5);
x_8 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_8, 0, x_7);
return x_8;
}
}
else
{
uint8_t x_9; 
x_9 = !lean_is_exclusive(x_5);
if (x_9 == 0)
{
lean_object* x_10; 
x_10 = lean_ctor_get(x_5, 0);
lean_ctor_set_tag(x_2, 0);
lean_ctor_set(x_2, 0, x_10);
lean_ctor_set(x_5, 0, x_2);
return x_5;
}
else
{
lean_object* x_11; lean_object* x_12; 
x_11 = lean_ctor_get(x_5, 0);
lean_inc(x_11);
lean_dec(x_5);
lean_ctor_set_tag(x_2, 0);
lean_ctor_set(x_2, 0, x_11);
x_12 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_12, 0, x_2);
return x_12;
}
}
}
else
{
lean_object* x_13; lean_object* x_14; 
x_13 = lean_ctor_get(x_2, 0);
lean_inc(x_13);
lean_dec(x_2);
x_14 = l_Array_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0_spec__0(x_13);
if (lean_obj_tag(x_14) == 0)
{
lean_object* x_15; lean_object* x_16; lean_object* x_17; 
x_15 = lean_ctor_get(x_14, 0);
lean_inc(x_15);
if (lean_is_exclusive(x_14)) {
 lean_ctor_release(x_14, 0);
 x_16 = x_14;
} else {
 lean_dec_ref(x_14);
 x_16 = lean_box(0);
}
if (lean_is_scalar(x_16)) {
 x_17 = lean_alloc_ctor(0, 1, 0);
} else {
 x_17 = x_16;
}
lean_ctor_set(x_17, 0, x_15);
return x_17;
}
else
{
lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; 
x_18 = lean_ctor_get(x_14, 0);
lean_inc(x_18);
if (lean_is_exclusive(x_14)) {
 lean_ctor_release(x_14, 0);
 x_19 = x_14;
} else {
 lean_dec_ref(x_14);
 x_19 = lean_box(0);
}
x_20 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_20, 0, x_18);
if (lean_is_scalar(x_19)) {
 x_21 = lean_alloc_ctor(1, 1, 0);
} else {
 x_21 = x_19;
}
lean_ctor_set(x_21, 0, x_20);
return x_21;
}
}
}
else
{
lean_object* x_22; 
lean_dec(x_2);
x_22 = l_Array_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0_spec__0(x_1);
if (lean_obj_tag(x_22) == 0)
{
uint8_t x_23; 
x_23 = !lean_is_exclusive(x_22);
if (x_23 == 0)
{
return x_22;
}
else
{
lean_object* x_24; lean_object* x_25; 
x_24 = lean_ctor_get(x_22, 0);
lean_inc(x_24);
lean_dec(x_22);
x_25 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_25, 0, x_24);
return x_25;
}
}
else
{
uint8_t x_26; 
x_26 = !lean_is_exclusive(x_22);
if (x_26 == 0)
{
lean_object* x_27; lean_object* x_28; 
x_27 = lean_ctor_get(x_22, 0);
x_28 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_28, 0, x_27);
lean_ctor_set(x_22, 0, x_28);
return x_22;
}
else
{
lean_object* x_29; lean_object* x_30; lean_object* x_31; 
x_29 = lean_ctor_get(x_22, 0);
lean_inc(x_29);
lean_dec(x_22);
x_30 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_30, 0, x_29);
x_31 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_31, 0, x_30);
return x_31;
}
}
}
}
}
}
LEAN_EXPORT lean_object* l_Lake_Reservoir_fetchPkgVersions(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
lean_object* x_6; lean_object* x_7; lean_object* x_8; 
lean_inc_ref(x_3);
lean_inc_ref(x_2);
x_6 = l_Lake_Reservoir_pkgVersionsApiUrl(x_1, x_2, x_3);
x_7 = l_Lake_Reservoir_fetchPkg_x3f___closed__0;
x_8 = l_Lake_getUrl(x_6, x_7, x_4);
if (lean_obj_tag(x_8) == 0)
{
uint8_t x_9; 
x_9 = !lean_is_exclusive(x_8);
if (x_9 == 0)
{
lean_object* x_10; lean_object* x_11; lean_object* x_12; 
x_10 = lean_ctor_get(x_8, 0);
x_11 = lean_ctor_get(x_8, 1);
lean_inc(x_10);
x_12 = l_Lean_Json_parse(x_10);
if (lean_obj_tag(x_12) == 0)
{
lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; uint8_t x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; uint8_t x_32; lean_object* x_33; lean_object* x_34; 
x_13 = lean_ctor_get(x_12, 0);
lean_inc(x_13);
lean_dec_ref(x_12);
x_14 = l_Lake_Reservoir_pkgApiUrl___closed__1;
x_15 = lean_string_append(x_2, x_14);
x_16 = lean_string_append(x_15, x_3);
lean_dec_ref(x_3);
x_17 = l_Lake_Reservoir_fetchPkg_x3f___closed__1;
lean_inc_ref(x_16);
x_18 = lean_string_append(x_16, x_17);
x_19 = lean_string_append(x_18, x_13);
lean_dec(x_13);
x_20 = 3;
x_21 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_21, 0, x_19);
lean_ctor_set_uint8(x_21, sizeof(void*)*1, x_20);
x_22 = lean_array_get_size(x_11);
x_23 = lean_array_push(x_11, x_21);
x_24 = l_Lake_Reservoir_fetchPkg_x3f___closed__2;
x_25 = lean_string_append(x_16, x_24);
x_26 = lean_unsigned_to_nat(0u);
x_27 = lean_string_utf8_byte_size(x_10);
x_28 = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(x_28, 0, x_10);
lean_ctor_set(x_28, 1, x_26);
lean_ctor_set(x_28, 2, x_27);
x_29 = l_String_Slice_trimAscii(x_28);
lean_dec_ref(x_28);
x_30 = l_String_Slice_toString(x_29);
lean_dec_ref(x_29);
x_31 = lean_string_append(x_25, x_30);
lean_dec_ref(x_30);
x_32 = 0;
x_33 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_33, 0, x_31);
lean_ctor_set_uint8(x_33, sizeof(void*)*1, x_32);
x_34 = lean_array_push(x_23, x_33);
lean_ctor_set_tag(x_8, 1);
lean_ctor_set(x_8, 1, x_34);
lean_ctor_set(x_8, 0, x_22);
return x_8;
}
else
{
lean_object* x_35; lean_object* x_36; 
x_35 = lean_ctor_get(x_12, 0);
lean_inc(x_35);
lean_dec_ref(x_12);
x_36 = l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0(x_35);
if (lean_obj_tag(x_36) == 0)
{
lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; uint8_t x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; uint8_t x_56; lean_object* x_57; lean_object* x_58; 
x_37 = lean_ctor_get(x_36, 0);
lean_inc(x_37);
lean_dec_ref(x_36);
x_38 = l_Lake_Reservoir_pkgApiUrl___closed__1;
x_39 = lean_string_append(x_2, x_38);
x_40 = lean_string_append(x_39, x_3);
lean_dec_ref(x_3);
x_41 = l_Lake_Reservoir_fetchPkg_x3f___closed__3;
lean_inc_ref(x_40);
x_42 = lean_string_append(x_40, x_41);
x_43 = lean_string_append(x_42, x_37);
lean_dec(x_37);
x_44 = 3;
x_45 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_45, 0, x_43);
lean_ctor_set_uint8(x_45, sizeof(void*)*1, x_44);
x_46 = lean_array_get_size(x_11);
x_47 = lean_array_push(x_11, x_45);
x_48 = l_Lake_Reservoir_fetchPkg_x3f___closed__2;
x_49 = lean_string_append(x_40, x_48);
x_50 = lean_unsigned_to_nat(0u);
x_51 = lean_string_utf8_byte_size(x_10);
x_52 = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(x_52, 0, x_10);
lean_ctor_set(x_52, 1, x_50);
lean_ctor_set(x_52, 2, x_51);
x_53 = l_String_Slice_trimAscii(x_52);
lean_dec_ref(x_52);
x_54 = l_String_Slice_toString(x_53);
lean_dec_ref(x_53);
x_55 = lean_string_append(x_49, x_54);
lean_dec_ref(x_54);
x_56 = 0;
x_57 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_57, 0, x_55);
lean_ctor_set_uint8(x_57, sizeof(void*)*1, x_56);
x_58 = lean_array_push(x_47, x_57);
lean_ctor_set_tag(x_8, 1);
lean_ctor_set(x_8, 1, x_58);
lean_ctor_set(x_8, 0, x_46);
return x_8;
}
else
{
lean_object* x_59; 
lean_dec(x_10);
x_59 = lean_ctor_get(x_36, 0);
lean_inc(x_59);
lean_dec_ref(x_36);
if (lean_obj_tag(x_59) == 0)
{
lean_object* x_60; 
lean_dec_ref(x_3);
lean_dec_ref(x_2);
x_60 = lean_ctor_get(x_59, 0);
lean_inc(x_60);
lean_dec_ref(x_59);
lean_ctor_set(x_8, 0, x_60);
return x_8;
}
else
{
lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; uint8_t x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; 
x_61 = lean_ctor_get(x_59, 0);
lean_inc(x_61);
x_62 = lean_ctor_get(x_59, 1);
lean_inc_ref(x_62);
lean_dec_ref(x_59);
x_63 = l_Lake_Reservoir_pkgApiUrl___closed__1;
x_64 = lean_string_append(x_2, x_63);
x_65 = lean_string_append(x_64, x_3);
lean_dec_ref(x_3);
x_66 = l_Lake_Reservoir_fetchPkgVersions___closed__0;
x_67 = lean_string_append(x_65, x_66);
x_68 = l_Nat_reprFast(x_61);
x_69 = lean_string_append(x_67, x_68);
lean_dec_ref(x_68);
x_70 = l_Lake_Reservoir_fetchPkgVersions___closed__1;
x_71 = lean_string_append(x_69, x_70);
x_72 = lean_string_append(x_71, x_62);
lean_dec_ref(x_62);
x_73 = 3;
x_74 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_74, 0, x_72);
lean_ctor_set_uint8(x_74, sizeof(void*)*1, x_73);
x_75 = lean_array_get_size(x_11);
x_76 = lean_array_push(x_11, x_74);
lean_ctor_set_tag(x_8, 1);
lean_ctor_set(x_8, 1, x_76);
lean_ctor_set(x_8, 0, x_75);
return x_8;
}
}
}
}
else
{
lean_object* x_77; lean_object* x_78; lean_object* x_79; 
x_77 = lean_ctor_get(x_8, 0);
x_78 = lean_ctor_get(x_8, 1);
lean_inc(x_78);
lean_inc(x_77);
lean_dec(x_8);
lean_inc(x_77);
x_79 = l_Lean_Json_parse(x_77);
if (lean_obj_tag(x_79) == 0)
{
lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; uint8_t x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; uint8_t x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; 
x_80 = lean_ctor_get(x_79, 0);
lean_inc(x_80);
lean_dec_ref(x_79);
x_81 = l_Lake_Reservoir_pkgApiUrl___closed__1;
x_82 = lean_string_append(x_2, x_81);
x_83 = lean_string_append(x_82, x_3);
lean_dec_ref(x_3);
x_84 = l_Lake_Reservoir_fetchPkg_x3f___closed__1;
lean_inc_ref(x_83);
x_85 = lean_string_append(x_83, x_84);
x_86 = lean_string_append(x_85, x_80);
lean_dec(x_80);
x_87 = 3;
x_88 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_88, 0, x_86);
lean_ctor_set_uint8(x_88, sizeof(void*)*1, x_87);
x_89 = lean_array_get_size(x_78);
x_90 = lean_array_push(x_78, x_88);
x_91 = l_Lake_Reservoir_fetchPkg_x3f___closed__2;
x_92 = lean_string_append(x_83, x_91);
x_93 = lean_unsigned_to_nat(0u);
x_94 = lean_string_utf8_byte_size(x_77);
x_95 = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(x_95, 0, x_77);
lean_ctor_set(x_95, 1, x_93);
lean_ctor_set(x_95, 2, x_94);
x_96 = l_String_Slice_trimAscii(x_95);
lean_dec_ref(x_95);
x_97 = l_String_Slice_toString(x_96);
lean_dec_ref(x_96);
x_98 = lean_string_append(x_92, x_97);
lean_dec_ref(x_97);
x_99 = 0;
x_100 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_100, 0, x_98);
lean_ctor_set_uint8(x_100, sizeof(void*)*1, x_99);
x_101 = lean_array_push(x_90, x_100);
x_102 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_102, 0, x_89);
lean_ctor_set(x_102, 1, x_101);
return x_102;
}
else
{
lean_object* x_103; lean_object* x_104; 
x_103 = lean_ctor_get(x_79, 0);
lean_inc(x_103);
lean_dec_ref(x_79);
x_104 = l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0(x_103);
if (lean_obj_tag(x_104) == 0)
{
lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; uint8_t x_112; lean_object* x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; lean_object* x_119; lean_object* x_120; lean_object* x_121; lean_object* x_122; lean_object* x_123; uint8_t x_124; lean_object* x_125; lean_object* x_126; lean_object* x_127; 
x_105 = lean_ctor_get(x_104, 0);
lean_inc(x_105);
lean_dec_ref(x_104);
x_106 = l_Lake_Reservoir_pkgApiUrl___closed__1;
x_107 = lean_string_append(x_2, x_106);
x_108 = lean_string_append(x_107, x_3);
lean_dec_ref(x_3);
x_109 = l_Lake_Reservoir_fetchPkg_x3f___closed__3;
lean_inc_ref(x_108);
x_110 = lean_string_append(x_108, x_109);
x_111 = lean_string_append(x_110, x_105);
lean_dec(x_105);
x_112 = 3;
x_113 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_113, 0, x_111);
lean_ctor_set_uint8(x_113, sizeof(void*)*1, x_112);
x_114 = lean_array_get_size(x_78);
x_115 = lean_array_push(x_78, x_113);
x_116 = l_Lake_Reservoir_fetchPkg_x3f___closed__2;
x_117 = lean_string_append(x_108, x_116);
x_118 = lean_unsigned_to_nat(0u);
x_119 = lean_string_utf8_byte_size(x_77);
x_120 = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(x_120, 0, x_77);
lean_ctor_set(x_120, 1, x_118);
lean_ctor_set(x_120, 2, x_119);
x_121 = l_String_Slice_trimAscii(x_120);
lean_dec_ref(x_120);
x_122 = l_String_Slice_toString(x_121);
lean_dec_ref(x_121);
x_123 = lean_string_append(x_117, x_122);
lean_dec_ref(x_122);
x_124 = 0;
x_125 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_125, 0, x_123);
lean_ctor_set_uint8(x_125, sizeof(void*)*1, x_124);
x_126 = lean_array_push(x_115, x_125);
x_127 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_127, 0, x_114);
lean_ctor_set(x_127, 1, x_126);
return x_127;
}
else
{
lean_object* x_128; 
lean_dec(x_77);
x_128 = lean_ctor_get(x_104, 0);
lean_inc(x_128);
lean_dec_ref(x_104);
if (lean_obj_tag(x_128) == 0)
{
lean_object* x_129; lean_object* x_130; 
lean_dec_ref(x_3);
lean_dec_ref(x_2);
x_129 = lean_ctor_get(x_128, 0);
lean_inc(x_129);
lean_dec_ref(x_128);
x_130 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_130, 0, x_129);
lean_ctor_set(x_130, 1, x_78);
return x_130;
}
else
{
lean_object* x_131; lean_object* x_132; lean_object* x_133; lean_object* x_134; lean_object* x_135; lean_object* x_136; lean_object* x_137; lean_object* x_138; lean_object* x_139; lean_object* x_140; lean_object* x_141; lean_object* x_142; uint8_t x_143; lean_object* x_144; lean_object* x_145; lean_object* x_146; lean_object* x_147; 
x_131 = lean_ctor_get(x_128, 0);
lean_inc(x_131);
x_132 = lean_ctor_get(x_128, 1);
lean_inc_ref(x_132);
lean_dec_ref(x_128);
x_133 = l_Lake_Reservoir_pkgApiUrl___closed__1;
x_134 = lean_string_append(x_2, x_133);
x_135 = lean_string_append(x_134, x_3);
lean_dec_ref(x_3);
x_136 = l_Lake_Reservoir_fetchPkgVersions___closed__0;
x_137 = lean_string_append(x_135, x_136);
x_138 = l_Nat_reprFast(x_131);
x_139 = lean_string_append(x_137, x_138);
lean_dec_ref(x_138);
x_140 = l_Lake_Reservoir_fetchPkgVersions___closed__1;
x_141 = lean_string_append(x_139, x_140);
x_142 = lean_string_append(x_141, x_132);
lean_dec_ref(x_132);
x_143 = 3;
x_144 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_144, 0, x_142);
lean_ctor_set_uint8(x_144, sizeof(void*)*1, x_143);
x_145 = lean_array_get_size(x_78);
x_146 = lean_array_push(x_78, x_144);
x_147 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_147, 0, x_145);
lean_ctor_set(x_147, 1, x_146);
return x_147;
}
}
}
}
}
else
{
uint8_t x_148; 
x_148 = !lean_is_exclusive(x_8);
if (x_148 == 0)
{
lean_object* x_149; lean_object* x_150; lean_object* x_151; lean_object* x_152; lean_object* x_153; lean_object* x_154; uint8_t x_155; lean_object* x_156; lean_object* x_157; 
x_149 = lean_ctor_get(x_8, 1);
x_150 = l_Lake_Reservoir_pkgApiUrl___closed__1;
x_151 = lean_string_append(x_2, x_150);
x_152 = lean_string_append(x_151, x_3);
lean_dec_ref(x_3);
x_153 = l_Lake_Reservoir_fetchPkg_x3f___closed__5;
x_154 = lean_string_append(x_152, x_153);
x_155 = 3;
x_156 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_156, 0, x_154);
lean_ctor_set_uint8(x_156, sizeof(void*)*1, x_155);
x_157 = lean_array_push(x_149, x_156);
lean_ctor_set(x_8, 1, x_157);
return x_8;
}
else
{
lean_object* x_158; lean_object* x_159; lean_object* x_160; lean_object* x_161; lean_object* x_162; lean_object* x_163; lean_object* x_164; uint8_t x_165; lean_object* x_166; lean_object* x_167; lean_object* x_168; 
x_158 = lean_ctor_get(x_8, 0);
x_159 = lean_ctor_get(x_8, 1);
lean_inc(x_159);
lean_inc(x_158);
lean_dec(x_8);
x_160 = l_Lake_Reservoir_pkgApiUrl___closed__1;
x_161 = lean_string_append(x_2, x_160);
x_162 = lean_string_append(x_161, x_3);
lean_dec_ref(x_3);
x_163 = l_Lake_Reservoir_fetchPkg_x3f___closed__5;
x_164 = lean_string_append(x_162, x_163);
x_165 = 3;
x_166 = lean_alloc_ctor(0, 1, 1);
lean_ctor_set(x_166, 0, x_164);
lean_ctor_set_uint8(x_166, sizeof(void*)*1, x_165);
x_167 = lean_array_push(x_159, x_166);
x_168 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_168, 0, x_158);
lean_ctor_set(x_168, 1, x_167);
return x_168;
}
}
}
}
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_mapMUnsafe_map___at___00Array_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0_spec__0_spec__0___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
size_t x_4; size_t x_5; lean_object* x_6; 
x_4 = lean_unbox_usize(x_1);
lean_dec(x_1);
x_5 = lean_unbox_usize(x_2);
lean_dec(x_2);
x_6 = l___private_Init_Data_Array_Basic_0__Array_mapMUnsafe_map___at___00Array_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0_spec__0_spec__0(x_4, x_5, x_3);
return x_6;
}
}
LEAN_EXPORT lean_object* l_Lake_Reservoir_fetchPkgVersions___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
lean_object* x_6; 
x_6 = l_Lake_Reservoir_fetchPkgVersions(x_1, x_2, x_3, x_4);
return x_6;
}
}
lean_object* initialize_Lake_Util_JsonObject(uint8_t builtin);
lean_object* initialize_Lake_Util_Version(uint8_t builtin);
lean_object* initialize_Lake_Config_Env(uint8_t builtin);
lean_object* initialize_Lake_Util_Reservoir(uint8_t builtin);
lean_object* initialize_Lake_Util_Proc(uint8_t builtin);
lean_object* initialize_Lake_Util_Url(uint8_t builtin);
static bool _G_initialized = false;
LEAN_EXPORT lean_object* initialize_Lake_Reservoir(uint8_t builtin) {
lean_object * res;
if (_G_initialized) return lean_io_result_mk_ok(lean_box(0));
_G_initialized = true;
res = initialize_Lake_Util_JsonObject(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lake_Util_Version(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lake_Config_Env(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lake_Util_Reservoir(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lake_Util_Proc(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lake_Util_Url(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_Lake_instInhabitedRegistrySrc_default___closed__0 = _init_l_Lake_instInhabitedRegistrySrc_default___closed__0();
lean_mark_persistent(l_Lake_instInhabitedRegistrySrc_default___closed__0);
l_Lake_instInhabitedRegistrySrc_default___closed__1 = _init_l_Lake_instInhabitedRegistrySrc_default___closed__1();
lean_mark_persistent(l_Lake_instInhabitedRegistrySrc_default___closed__1);
l_Lake_instInhabitedRegistrySrc_default = _init_l_Lake_instInhabitedRegistrySrc_default();
lean_mark_persistent(l_Lake_instInhabitedRegistrySrc_default);
l_Lake_instInhabitedRegistrySrc = _init_l_Lake_instInhabitedRegistrySrc();
lean_mark_persistent(l_Lake_instInhabitedRegistrySrc);
l_Lake_RegistrySrc_instToJson___closed__0 = _init_l_Lake_RegistrySrc_instToJson___closed__0();
lean_mark_persistent(l_Lake_RegistrySrc_instToJson___closed__0);
l_Lake_RegistrySrc_instToJson = _init_l_Lake_RegistrySrc_instToJson();
lean_mark_persistent(l_Lake_RegistrySrc_instToJson);
l_Option_fromJson_x3f___at___00Lake_RegistrySrc_fromJson_x3f_spec__0___closed__0 = _init_l_Option_fromJson_x3f___at___00Lake_RegistrySrc_fromJson_x3f_spec__0___closed__0();
lean_mark_persistent(l_Option_fromJson_x3f___at___00Lake_RegistrySrc_fromJson_x3f_spec__0___closed__0);
l_Lake_RegistrySrc_fromJson_x3f___closed__0 = _init_l_Lake_RegistrySrc_fromJson_x3f___closed__0();
lean_mark_persistent(l_Lake_RegistrySrc_fromJson_x3f___closed__0);
l_Lake_RegistrySrc_fromJson_x3f___closed__1 = _init_l_Lake_RegistrySrc_fromJson_x3f___closed__1();
lean_mark_persistent(l_Lake_RegistrySrc_fromJson_x3f___closed__1);
l_Lake_RegistrySrc_fromJson_x3f___closed__2 = _init_l_Lake_RegistrySrc_fromJson_x3f___closed__2();
lean_mark_persistent(l_Lake_RegistrySrc_fromJson_x3f___closed__2);
l_Lake_RegistrySrc_fromJson_x3f___closed__3 = _init_l_Lake_RegistrySrc_fromJson_x3f___closed__3();
lean_mark_persistent(l_Lake_RegistrySrc_fromJson_x3f___closed__3);
l_Lake_RegistrySrc_fromJson_x3f___closed__4 = _init_l_Lake_RegistrySrc_fromJson_x3f___closed__4();
lean_mark_persistent(l_Lake_RegistrySrc_fromJson_x3f___closed__4);
l_Lake_RegistrySrc_fromJson_x3f___closed__5 = _init_l_Lake_RegistrySrc_fromJson_x3f___closed__5();
lean_mark_persistent(l_Lake_RegistrySrc_fromJson_x3f___closed__5);
l_Lake_RegistrySrc_fromJson_x3f___closed__6 = _init_l_Lake_RegistrySrc_fromJson_x3f___closed__6();
lean_mark_persistent(l_Lake_RegistrySrc_fromJson_x3f___closed__6);
l_Lake_RegistrySrc_fromJson_x3f___closed__7 = _init_l_Lake_RegistrySrc_fromJson_x3f___closed__7();
lean_mark_persistent(l_Lake_RegistrySrc_fromJson_x3f___closed__7);
l_Lake_RegistrySrc_fromJson_x3f___closed__8 = _init_l_Lake_RegistrySrc_fromJson_x3f___closed__8();
lean_mark_persistent(l_Lake_RegistrySrc_fromJson_x3f___closed__8);
l_Lake_RegistrySrc_fromJson_x3f___closed__9 = _init_l_Lake_RegistrySrc_fromJson_x3f___closed__9();
lean_mark_persistent(l_Lake_RegistrySrc_fromJson_x3f___closed__9);
l_Lake_RegistrySrc_fromJson_x3f___closed__10 = _init_l_Lake_RegistrySrc_fromJson_x3f___closed__10();
lean_mark_persistent(l_Lake_RegistrySrc_fromJson_x3f___closed__10);
l_Lake_RegistrySrc_fromJson_x3f___closed__11 = _init_l_Lake_RegistrySrc_fromJson_x3f___closed__11();
lean_mark_persistent(l_Lake_RegistrySrc_fromJson_x3f___closed__11);
l_Lake_RegistrySrc_instFromJson___closed__0 = _init_l_Lake_RegistrySrc_instFromJson___closed__0();
lean_mark_persistent(l_Lake_RegistrySrc_instFromJson___closed__0);
l_Lake_RegistrySrc_instFromJson = _init_l_Lake_RegistrySrc_instFromJson();
lean_mark_persistent(l_Lake_RegistrySrc_instFromJson);
l_Lake_instInhabitedRegistryPkg_default___closed__0 = _init_l_Lake_instInhabitedRegistryPkg_default___closed__0();
lean_mark_persistent(l_Lake_instInhabitedRegistryPkg_default___closed__0);
l_Lake_instInhabitedRegistryPkg_default___closed__1 = _init_l_Lake_instInhabitedRegistryPkg_default___closed__1();
lean_mark_persistent(l_Lake_instInhabitedRegistryPkg_default___closed__1);
l_Lake_instInhabitedRegistryPkg_default = _init_l_Lake_instInhabitedRegistryPkg_default();
lean_mark_persistent(l_Lake_instInhabitedRegistryPkg_default);
l_Lake_instInhabitedRegistryPkg = _init_l_Lake_instInhabitedRegistryPkg();
lean_mark_persistent(l_Lake_instInhabitedRegistryPkg);
l_Lake_RegistryPkg_gitSrc_x3f___closed__0 = _init_l_Lake_RegistryPkg_gitSrc_x3f___closed__0();
lean_mark_persistent(l_Lake_RegistryPkg_gitSrc_x3f___closed__0);
l___private_Lake_Reservoir_0__Lake_RegistryPkg_instToJson___closed__0 = _init_l___private_Lake_Reservoir_0__Lake_RegistryPkg_instToJson___closed__0();
lean_mark_persistent(l___private_Lake_Reservoir_0__Lake_RegistryPkg_instToJson___closed__0);
l___private_Lake_Reservoir_0__Lake_RegistryPkg_instToJson = _init_l___private_Lake_Reservoir_0__Lake_RegistryPkg_instToJson();
lean_mark_persistent(l___private_Lake_Reservoir_0__Lake_RegistryPkg_instToJson);
l_Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1___closed__0 = _init_l_Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1___closed__0();
lean_mark_persistent(l_Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1___closed__0);
l_Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1___closed__0 = _init_l_Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1___closed__0();
lean_mark_persistent(l_Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1___closed__0);
l_Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1___closed__1 = _init_l_Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1___closed__1();
lean_mark_persistent(l_Array_fromJson_x3f___at___00Option_fromJson_x3f___at___00Lake_RegistryPkg_fromJson_x3f_spec__1_spec__1___closed__1);
l_Lake_RegistryPkg_fromJson_x3f___closed__0 = _init_l_Lake_RegistryPkg_fromJson_x3f___closed__0();
lean_mark_persistent(l_Lake_RegistryPkg_fromJson_x3f___closed__0);
l_Lake_RegistryPkg_fromJson_x3f___closed__1 = _init_l_Lake_RegistryPkg_fromJson_x3f___closed__1();
lean_mark_persistent(l_Lake_RegistryPkg_fromJson_x3f___closed__1);
l_Lake_RegistryPkg_fromJson_x3f___closed__2 = _init_l_Lake_RegistryPkg_fromJson_x3f___closed__2();
lean_mark_persistent(l_Lake_RegistryPkg_fromJson_x3f___closed__2);
l_Lake_RegistryPkg_fromJson_x3f___closed__3 = _init_l_Lake_RegistryPkg_fromJson_x3f___closed__3();
lean_mark_persistent(l_Lake_RegistryPkg_fromJson_x3f___closed__3);
l_Lake_RegistryPkg_fromJson_x3f___closed__4 = _init_l_Lake_RegistryPkg_fromJson_x3f___closed__4();
lean_mark_persistent(l_Lake_RegistryPkg_fromJson_x3f___closed__4);
l_Lake_RegistryPkg_fromJson_x3f___closed__5 = _init_l_Lake_RegistryPkg_fromJson_x3f___closed__5();
lean_mark_persistent(l_Lake_RegistryPkg_fromJson_x3f___closed__5);
l_Lake_RegistryPkg_fromJson_x3f___closed__6 = _init_l_Lake_RegistryPkg_fromJson_x3f___closed__6();
lean_mark_persistent(l_Lake_RegistryPkg_fromJson_x3f___closed__6);
l_Lake_RegistryPkg_fromJson_x3f___closed__7 = _init_l_Lake_RegistryPkg_fromJson_x3f___closed__7();
lean_mark_persistent(l_Lake_RegistryPkg_fromJson_x3f___closed__7);
l_Lake_RegistryPkg_fromJson_x3f___closed__8 = _init_l_Lake_RegistryPkg_fromJson_x3f___closed__8();
lean_mark_persistent(l_Lake_RegistryPkg_fromJson_x3f___closed__8);
l_Lake_RegistryPkg_fromJson_x3f___closed__9 = _init_l_Lake_RegistryPkg_fromJson_x3f___closed__9();
lean_mark_persistent(l_Lake_RegistryPkg_fromJson_x3f___closed__9);
l_Lake_RegistryPkg_instFromJson___closed__0 = _init_l_Lake_RegistryPkg_instFromJson___closed__0();
lean_mark_persistent(l_Lake_RegistryPkg_instFromJson___closed__0);
l_Lake_RegistryPkg_instFromJson = _init_l_Lake_RegistryPkg_instFromJson();
lean_mark_persistent(l_Lake_RegistryPkg_instFromJson);
l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__0 = _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__0();
lean_mark_persistent(l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__0);
l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__1 = _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__1();
lean_mark_persistent(l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__1);
l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__2 = _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__2();
lean_mark_persistent(l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__2);
l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__3 = _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__3();
lean_mark_persistent(l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__3);
l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__4 = _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__4();
lean_mark_persistent(l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__4);
l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__5 = _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__5();
lean_mark_persistent(l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__5);
l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__6 = _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__6();
lean_mark_persistent(l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__6);
l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__7 = _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__7();
lean_mark_persistent(l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__7);
l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__8 = _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__8();
lean_mark_persistent(l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__8);
l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__9 = _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__9();
lean_mark_persistent(l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__9);
l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__10 = _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__10();
lean_mark_persistent(l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__10);
l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__11 = _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__11();
lean_mark_persistent(l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__11);
l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__12 = _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__12();
lean_mark_persistent(l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__12);
l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__13 = _init_l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__13();
lean_mark_persistent(l_Lake_ReservoirResp_fromJson_x3f___redArg___closed__13);
l_Lake_Reservoir_pkgApiUrl___closed__0 = _init_l_Lake_Reservoir_pkgApiUrl___closed__0();
lean_mark_persistent(l_Lake_Reservoir_pkgApiUrl___closed__0);
l_Lake_Reservoir_pkgApiUrl___closed__1 = _init_l_Lake_Reservoir_pkgApiUrl___closed__1();
lean_mark_persistent(l_Lake_Reservoir_pkgApiUrl___closed__1);
l_Option_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0_spec__0___closed__0 = _init_l_Option_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0_spec__0___closed__0();
lean_mark_persistent(l_Option_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0_spec__0___closed__0);
l_Option_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0_spec__1___closed__0 = _init_l_Option_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0_spec__1___closed__0();
lean_mark_persistent(l_Option_fromJson_x3f___at___00Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0_spec__1___closed__0);
l_Lake_Reservoir_fetchPkg_x3f___closed__0 = _init_l_Lake_Reservoir_fetchPkg_x3f___closed__0();
lean_mark_persistent(l_Lake_Reservoir_fetchPkg_x3f___closed__0);
l_Lake_Reservoir_fetchPkg_x3f___closed__1 = _init_l_Lake_Reservoir_fetchPkg_x3f___closed__1();
lean_mark_persistent(l_Lake_Reservoir_fetchPkg_x3f___closed__1);
l_Lake_Reservoir_fetchPkg_x3f___closed__2 = _init_l_Lake_Reservoir_fetchPkg_x3f___closed__2();
lean_mark_persistent(l_Lake_Reservoir_fetchPkg_x3f___closed__2);
l_Lake_Reservoir_fetchPkg_x3f___closed__3 = _init_l_Lake_Reservoir_fetchPkg_x3f___closed__3();
lean_mark_persistent(l_Lake_Reservoir_fetchPkg_x3f___closed__3);
l_Lake_Reservoir_fetchPkg_x3f___closed__4 = _init_l_Lake_Reservoir_fetchPkg_x3f___closed__4();
lean_mark_persistent(l_Lake_Reservoir_fetchPkg_x3f___closed__4);
l_Lake_Reservoir_fetchPkg_x3f___closed__5 = _init_l_Lake_Reservoir_fetchPkg_x3f___closed__5();
lean_mark_persistent(l_Lake_Reservoir_fetchPkg_x3f___closed__5);
l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0___closed__0 = _init_l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0___closed__0();
lean_mark_persistent(l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0___closed__0);
l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0___closed__1 = _init_l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0___closed__1();
lean_mark_persistent(l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkg_x3f_spec__0___closed__1);
l_Lake_RegistryVer_fromJson_x3f___closed__0 = _init_l_Lake_RegistryVer_fromJson_x3f___closed__0();
lean_mark_persistent(l_Lake_RegistryVer_fromJson_x3f___closed__0);
l_Lake_RegistryVer_fromJson_x3f___closed__1 = _init_l_Lake_RegistryVer_fromJson_x3f___closed__1();
lean_mark_persistent(l_Lake_RegistryVer_fromJson_x3f___closed__1);
l_Lake_RegistryVer_fromJson_x3f___closed__2 = _init_l_Lake_RegistryVer_fromJson_x3f___closed__2();
lean_mark_persistent(l_Lake_RegistryVer_fromJson_x3f___closed__2);
l_Lake_RegistryVer_fromJson_x3f___closed__3 = _init_l_Lake_RegistryVer_fromJson_x3f___closed__3();
lean_mark_persistent(l_Lake_RegistryVer_fromJson_x3f___closed__3);
l_Lake_RegistryVer_fromJson_x3f___closed__4 = _init_l_Lake_RegistryVer_fromJson_x3f___closed__4();
lean_mark_persistent(l_Lake_RegistryVer_fromJson_x3f___closed__4);
l_Lake_RegistryVer_fromJson_x3f___closed__5 = _init_l_Lake_RegistryVer_fromJson_x3f___closed__5();
lean_mark_persistent(l_Lake_RegistryVer_fromJson_x3f___closed__5);
l_Lake_RegistryVer_fromJson_x3f___closed__6 = _init_l_Lake_RegistryVer_fromJson_x3f___closed__6();
lean_mark_persistent(l_Lake_RegistryVer_fromJson_x3f___closed__6);
l_Lake_RegistryVer_fromJson_x3f___closed__7 = _init_l_Lake_RegistryVer_fromJson_x3f___closed__7();
lean_mark_persistent(l_Lake_RegistryVer_fromJson_x3f___closed__7);
l_Lake_instFromJsonRegistryVer___closed__0 = _init_l_Lake_instFromJsonRegistryVer___closed__0();
lean_mark_persistent(l_Lake_instFromJsonRegistryVer___closed__0);
l_Lake_instFromJsonRegistryVer = _init_l_Lake_instFromJsonRegistryVer();
lean_mark_persistent(l_Lake_instFromJsonRegistryVer);
l_Lake_Reservoir_pkgVersionsApiUrl___closed__0 = _init_l_Lake_Reservoir_pkgVersionsApiUrl___closed__0();
lean_mark_persistent(l_Lake_Reservoir_pkgVersionsApiUrl___closed__0);
l_Lake_Reservoir_fetchPkgVersions___closed__0 = _init_l_Lake_Reservoir_fetchPkgVersions___closed__0();
lean_mark_persistent(l_Lake_Reservoir_fetchPkgVersions___closed__0);
l_Lake_Reservoir_fetchPkgVersions___closed__1 = _init_l_Lake_Reservoir_fetchPkgVersions___closed__1();
lean_mark_persistent(l_Lake_Reservoir_fetchPkgVersions___closed__1);
l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0___closed__0 = _init_l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0___closed__0();
lean_mark_persistent(l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0___closed__0);
l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0___closed__1 = _init_l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0___closed__1();
lean_mark_persistent(l_Lake_ReservoirResp_fromJson_x3f___at___00Lake_Reservoir_fetchPkgVersions_spec__0___closed__1);
return lean_io_result_mk_ok(lean_box(0));
}
#ifdef __cplusplus
}
#endif
